2020-01-06 12:10:40 +00:00
|
|
|
import { Vector3 } from '../Vector3';
|
|
|
|
|
import { UUID } from '../UUID';
|
|
|
|
|
import { Quaternion } from '../Quaternion';
|
|
|
|
|
import { Tree } from '../../enums/Tree';
|
|
|
|
|
import { Vector4 } from '../Vector4';
|
|
|
|
|
import { TextureEntry } from '../TextureEntry';
|
|
|
|
|
import { Color4 } from '../Color4';
|
|
|
|
|
import { ParticleSystem } from '../ParticleSystem';
|
|
|
|
|
import { ITreeBoundingBox } from '../interfaces/ITreeBoundingBox';
|
|
|
|
|
import { NameValue } from '../NameValue';
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
import * as Long from 'long';
|
2020-01-06 12:10:40 +00:00
|
|
|
import { IGameObjectData } from '../interfaces/IGameObjectData';
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
import * as builder from 'xmlbuilder';
|
2020-11-19 16:51:14 +00:00
|
|
|
import { XMLElement, XMLNode } from 'xmlbuilder';
|
2020-01-06 12:10:40 +00:00
|
|
|
import { Region } from '../Region';
|
|
|
|
|
import { InventoryItem } from '../InventoryItem';
|
|
|
|
|
import { LLWearable } from '../LLWearable';
|
|
|
|
|
import { TextureAnim } from './TextureAnim';
|
|
|
|
|
import { ExtraParams } from './ExtraParams';
|
|
|
|
|
import { ObjectExtraParamsMessage } from '../messages/ObjectExtraParams';
|
|
|
|
|
import { ExtraParamType } from '../../enums/ExtraParamType';
|
|
|
|
|
import { ObjectImageMessage } from '../messages/ObjectImage';
|
|
|
|
|
import { ObjectNameMessage } from '../messages/ObjectName';
|
|
|
|
|
import { ObjectDescriptionMessage } from '../messages/ObjectDescription';
|
|
|
|
|
import { MultipleObjectUpdateMessage } from '../messages/MultipleObjectUpdate';
|
|
|
|
|
import { UpdateType } from '../../enums/UpdateType';
|
|
|
|
|
import { ObjectLinkMessage } from '../messages/ObjectLink';
|
|
|
|
|
import { ObjectShapeMessage } from '../messages/ObjectShape';
|
|
|
|
|
import { PrimFlags } from '../../enums/PrimFlags';
|
|
|
|
|
import { Utils } from '../Utils';
|
|
|
|
|
import { ProfileShape } from '../../enums/ProfileShape';
|
|
|
|
|
import { HoleType } from '../../enums/HoleType';
|
|
|
|
|
import { SculptType } from '../../enums/SculptType';
|
|
|
|
|
import { PacketFlags } from '../../enums/PacketFlags';
|
|
|
|
|
import { HTTPAssets } from '../../enums/HTTPAssets';
|
|
|
|
|
import { PhysicsShapeType } from '../../enums/PhysicsShapeType';
|
|
|
|
|
import { PCode } from '../../enums/PCode';
|
|
|
|
|
import { SoundFlags } from '../../enums/SoundFlags';
|
2020-01-09 17:53:22 +00:00
|
|
|
import { DeRezObjectMessage } from '../messages/DeRezObject';
|
|
|
|
|
import { DeRezDestination } from '../../enums/DeRezDestination';
|
|
|
|
|
import { Message } from '../../enums/Message';
|
|
|
|
|
import { UpdateCreateInventoryItemMessage } from '../messages/UpdateCreateInventoryItem';
|
|
|
|
|
import { FilterResponse } from '../../enums/FilterResponse';
|
|
|
|
|
import { UpdateTaskInventoryMessage } from '../messages/UpdateTaskInventory';
|
|
|
|
|
import { ObjectPropertiesMessage } from '../messages/ObjectProperties';
|
|
|
|
|
import { ObjectSelectMessage } from '../messages/ObjectSelect';
|
|
|
|
|
import { ObjectDeselectMessage } from '../messages/ObjectDeselect';
|
2020-11-19 16:51:14 +00:00
|
|
|
import { AttachmentPoint } from '../../enums/AttachmentPoint';
|
|
|
|
|
import { RequestTaskInventoryMessage } from '../messages/RequestTaskInventory';
|
|
|
|
|
import { ReplyTaskInventoryMessage } from '../messages/ReplyTaskInventory';
|
|
|
|
|
import { InventoryType } from '../../enums/InventoryType';
|
|
|
|
|
import { InventoryFolder } from '../InventoryFolder';
|
|
|
|
|
import { ObjectUpdateMessage } from '../messages/ObjectUpdate';
|
|
|
|
|
import { Subject } from 'rxjs';
|
|
|
|
|
import { RezScriptMessage } from '../messages/RezScript';
|
|
|
|
|
import { PermissionMask } from '../../enums/PermissionMask';
|
|
|
|
|
import { AssetType } from '../../enums/AssetType';
|
2023-11-16 02:03:08 +00:00
|
|
|
import { LLGLTFMaterialOverride } from '../LLGLTFMaterialOverride';
|
2020-11-19 16:51:14 +00:00
|
|
|
|
|
|
|
|
import * as uuid from 'uuid';
|
2023-11-30 18:55:40 +00:00
|
|
|
import { Logger } from '../Logger';
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
|
|
|
|
|
export class GameObject implements IGameObjectData
|
|
|
|
|
{
|
|
|
|
|
rtreeEntry?: ITreeBoundingBox;
|
2018-11-05 11:45:04 +00:00
|
|
|
|
|
|
|
|
textureAnim: TextureAnim;
|
|
|
|
|
extraParams: ExtraParams;
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
|
|
|
|
|
deleted = false;
|
|
|
|
|
creatorID?: UUID;
|
|
|
|
|
creationDate?: Long;
|
|
|
|
|
baseMask?: number;
|
|
|
|
|
ownerMask?: number;
|
|
|
|
|
groupMask?: number;
|
|
|
|
|
groupID?: UUID;
|
|
|
|
|
everyoneMask?: number;
|
|
|
|
|
nextOwnerMask?: number;
|
|
|
|
|
ownershipCost?: number;
|
|
|
|
|
saleType?: number;
|
|
|
|
|
salePrice?: number;
|
|
|
|
|
aggregatePerms?: number;
|
|
|
|
|
aggregatePermTextures?: number;
|
|
|
|
|
aggregatePermTexturesOwner?: number;
|
|
|
|
|
category: number;
|
|
|
|
|
inventorySerial: number;
|
|
|
|
|
itemID: UUID;
|
|
|
|
|
folderID: UUID;
|
|
|
|
|
fromTaskID: UUID;
|
|
|
|
|
lastOwnerID: UUID;
|
|
|
|
|
name?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
touchName?: string;
|
|
|
|
|
sitName?: string;
|
|
|
|
|
textureID?: string;
|
|
|
|
|
resolvedAt?: number;
|
2020-11-19 16:51:14 +00:00
|
|
|
resolvedInventory = false;
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
totalChildren?: number;
|
|
|
|
|
|
|
|
|
|
landImpact?: number;
|
|
|
|
|
calculatedLandImpact?: number;
|
|
|
|
|
physicaImpact?: number;
|
|
|
|
|
resourceImpact?: number;
|
|
|
|
|
linkResourceImpact?: number;
|
|
|
|
|
linkPhysicsImpact?: number;
|
|
|
|
|
limitingType?: string;
|
|
|
|
|
|
|
|
|
|
children?: GameObject[];
|
|
|
|
|
ID = 0;
|
|
|
|
|
FullID = UUID.random();
|
|
|
|
|
ParentID?: number;
|
|
|
|
|
OwnerID = UUID.zero();
|
|
|
|
|
IsAttachment = false;
|
2021-09-23 17:21:36 +01:00
|
|
|
NameValue: { [key: string]: NameValue } = {};
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
PCode: PCode = PCode.None;
|
|
|
|
|
|
|
|
|
|
State?: number;
|
|
|
|
|
CRC?: number;
|
|
|
|
|
Material?: number;
|
|
|
|
|
ClickAction?: number;
|
|
|
|
|
Scale?: Vector3;
|
|
|
|
|
Flags?: PrimFlags;
|
|
|
|
|
PathCurve?: number;
|
|
|
|
|
ProfileCurve?: number;
|
|
|
|
|
PathBegin?: number;
|
|
|
|
|
PathEnd?: number;
|
|
|
|
|
PathScaleX?: number;
|
|
|
|
|
PathScaleY?: number;
|
|
|
|
|
PathShearX?: number;
|
|
|
|
|
PathShearY?: number;
|
|
|
|
|
PathTwist?: number;
|
|
|
|
|
PathTwistBegin?: number;
|
|
|
|
|
PathRadiusOffset?: number;
|
|
|
|
|
PathTaperX?: number;
|
|
|
|
|
PathTaperY?: number;
|
|
|
|
|
PathRevolutions?: number;
|
|
|
|
|
PathSkew?: number;
|
|
|
|
|
ProfileBegin?: number;
|
|
|
|
|
ProfileEnd?: number;
|
|
|
|
|
ProfileHollow?: number;
|
|
|
|
|
TextureEntry?: TextureEntry;
|
|
|
|
|
Text?: string;
|
|
|
|
|
TextColor?: Color4;
|
|
|
|
|
MediaURL?: string;
|
|
|
|
|
JointType?: number;
|
|
|
|
|
JointPivot?: Vector3;
|
|
|
|
|
JointAxisOrAnchor?: Vector3;
|
|
|
|
|
Position?: Vector3;
|
|
|
|
|
Rotation?: Quaternion;
|
|
|
|
|
CollisionPlane?: Vector4;
|
|
|
|
|
Velocity?: Vector3;
|
|
|
|
|
Acceleration?: Vector3;
|
|
|
|
|
AngularVelocity?: Vector3;
|
|
|
|
|
TreeSpecies?: Tree;
|
|
|
|
|
Sound?: UUID;
|
|
|
|
|
SoundGain?: number;
|
|
|
|
|
SoundFlags?: SoundFlags;
|
|
|
|
|
SoundRadius?: number;
|
|
|
|
|
Particles?: ParticleSystem;
|
|
|
|
|
|
|
|
|
|
density?: number;
|
|
|
|
|
friction?: number;
|
|
|
|
|
gravityMultiplier?: number;
|
|
|
|
|
physicsShapeType?: PhysicsShapeType;
|
|
|
|
|
restitution?: number;
|
2020-11-19 16:51:14 +00:00
|
|
|
attachmentPoint: AttachmentPoint = AttachmentPoint.Default;
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
|
|
|
|
|
region: Region;
|
|
|
|
|
|
|
|
|
|
inventory: InventoryItem[] = [];
|
|
|
|
|
|
|
|
|
|
resolveAttempts = 0;
|
|
|
|
|
|
2018-11-15 03:10:14 +00:00
|
|
|
claimedForBuild = false;
|
2020-01-09 17:53:22 +00:00
|
|
|
createdSelected = false;
|
2020-11-19 16:51:14 +00:00
|
|
|
isMarkedRoot = false;
|
|
|
|
|
onTextureUpdate: Subject<void> = new Subject<void>();
|
2018-11-15 03:10:14 +00:00
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
private static partFromXMLJS(obj: any, isRoot: boolean): GameObject
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
const go = new GameObject();
|
|
|
|
|
go.Flags = 0;
|
|
|
|
|
let prop: any;
|
2020-11-19 16:51:14 +00:00
|
|
|
if (Utils.getFromXMLJS(obj, 'AllowedDrop') !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.Flags = go.Flags | PrimFlags.AllowInventoryDrop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'CreatorID')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.creatorID = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'FolderID')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.folderID = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'InventorySerial')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.inventorySerial = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'UUID')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.FullID = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'LocalId')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.ID = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'Name')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
go.name = String(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'Material')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.Material = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = Vector3.fromXMLJS(obj, 'GroupPosition')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
if (isRoot)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.Position = prop;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = Vector3.fromXMLJS(obj, 'OffsetPosition')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
if (!isRoot)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.Position = prop;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = Quaternion.fromXMLJS(obj, 'RotationOffset')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.Rotation = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = Vector3.fromXMLJS(obj, 'Velocity')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.Velocity = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = Vector3.fromXMLJS(obj, 'AngularVelocity')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.AngularVelocity = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = Vector3.fromXMLJS(obj, 'Acceleration')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.Acceleration = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'Description')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
go.description = String(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'Text')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
go.Text = String(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = Color4.fromXMLJS(obj, 'Color')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.TextColor = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'SitName')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
go.sitName = String(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'TouchName')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
go.touchName = String(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'ClickAction')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.ClickAction = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = Vector3.fromXMLJS(obj, 'Scale')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.Scale = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'ParentID')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.ParentID = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'Category')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.category = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'SalePrice')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.salePrice = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'ObjectSaleType')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.saleType = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'OwnershipCost')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.ownershipCost = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'GroupID')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.groupID = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'OwnerID')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.OwnerID = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'LastOwnerID')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.lastOwnerID = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'BaseMask')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.baseMask = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'OwnerMask')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.ownerMask = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'GroupMask')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.groupMask = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'EveryoneMask')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.everyoneMask = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'NextOwnerMask')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.nextOwnerMask = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'Flags')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
let flags = 0;
|
|
|
|
|
if (typeof prop === 'string')
|
|
|
|
|
{
|
|
|
|
|
const flagList = prop.split(' ');
|
|
|
|
|
for (const flag of flagList)
|
|
|
|
|
{
|
|
|
|
|
const f: any = String(flag);
|
|
|
|
|
if (PrimFlags[f])
|
|
|
|
|
{
|
|
|
|
|
flags = flags | parseInt(PrimFlags[f], 10);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
go.Flags = flags;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'TextureAnimation')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
const buf = Buffer.from(prop, 'base64');
|
|
|
|
|
go.textureAnim = TextureAnim.from(buf);
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'ParticleSystem')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
const buf = Buffer.from(prop, 'base64');
|
|
|
|
|
go.Particles = ParticleSystem.from(buf);
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'PhysicsShapeType')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.physicsShapeType = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'SoundID')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.Sound = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'SoundGain')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.SoundGain = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'SoundFlags')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.SoundFlags = prop;
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
if ((prop = UUID.fromXMLJS(obj, 'SoundRadius')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.SoundRadius = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'Shape')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
const shape = prop;
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'ProfileCurve')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.ProfileCurve = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'TextureEntry')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
const buf = Buffer.from(prop, 'base64');
|
2018-11-15 03:10:14 +00:00
|
|
|
go.TextureEntry = TextureEntry.from(buf);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2023-11-16 02:03:08 +00:00
|
|
|
if (go.TextureEntry && shape['MatOvrd'] && Array.isArray(shape['MatOvrd']) && shape['MatOvrd'].length > 0)
|
2023-11-10 23:57:26 +00:00
|
|
|
{
|
2023-11-16 02:03:08 +00:00
|
|
|
const tex = Buffer.from(shape['MatOvrd'][0], 'base64');
|
|
|
|
|
let pos = 0;
|
|
|
|
|
const entryCount = tex.readUInt8(pos++);
|
|
|
|
|
for (let x = 0; x < entryCount; x++)
|
2023-11-10 23:57:26 +00:00
|
|
|
{
|
2023-11-16 02:03:08 +00:00
|
|
|
const te_index = tex.readUInt8(pos++);
|
|
|
|
|
const len = tex.readUInt16LE(pos++);
|
|
|
|
|
pos++;
|
|
|
|
|
const json = tex.slice(pos, pos + len).toString('utf-8');
|
|
|
|
|
pos = pos + len;
|
|
|
|
|
go.TextureEntry.gltfMaterialOverrides.set(te_index, LLGLTFMaterialOverride.fromFullMaterialJSON(json));
|
2023-11-10 23:57:26 +00:00
|
|
|
}
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathBegin')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathBegin = Utils.unpackBeginCut(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathCurve')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.PathCurve = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathEnd')) !== undefined)
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
go.PathEnd = Utils.unpackEndCut(prop);
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathRadiusOffset')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathRadiusOffset = Utils.unpackPathTwist(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathRevolutions')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathRevolutions = Utils.unpackPathRevolutions(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathScaleX')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathScaleX = Utils.unpackPathScale(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathScaleY')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathScaleY = Utils.unpackPathScale(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathShearX')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathShearX = Utils.unpackPathShear(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathShearY')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathShearY = Utils.unpackPathShear(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathSkew')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathSkew = Utils.unpackPathShear(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathTaperX')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathTaperX = Utils.unpackPathTaper(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathTaperY')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathTaperY = Utils.unpackPathTaper(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathTwist')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathTwist = Utils.unpackPathTwist(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PathTwistBegin')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.PathTwistBegin = Utils.unpackPathTwist(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'PCode')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
go.PCode = prop;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'ProfileBegin')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.ProfileBegin = Utils.unpackBeginCut(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'ProfileEnd')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.ProfileEnd = Utils.unpackEndCut(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'ProfileHollow')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
go.ProfileHollow = Utils.unpackProfileHollow(prop);
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'State')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
go.attachmentPoint = parseInt(prop, 10);
|
|
|
|
|
const mask = 0xf << 4 >>> 0;
|
|
|
|
|
go.State = (((prop & mask) >>> 4) | ((prop & ~mask) << 4)) >>> 0;
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'ProfileShape')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
if (!go.ProfileCurve)
|
|
|
|
|
{
|
|
|
|
|
go.ProfileCurve = 0;
|
|
|
|
|
}
|
|
|
|
|
go.ProfileCurve = go.ProfileCurve | parseInt(ProfileShape[prop], 10);
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'HollowShape')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
if (!go.ProfileCurve)
|
|
|
|
|
{
|
|
|
|
|
go.ProfileCurve = 0;
|
|
|
|
|
}
|
|
|
|
|
go.ProfileCurve = go.ProfileCurve | parseInt(HoleType[prop], 10);
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if (Utils.getFromXMLJS(shape, 'SculptEntry') !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
const type = Utils.getFromXMLJS(shape, 'SculptType');
|
2018-11-05 11:45:04 +00:00
|
|
|
if (type !== false && type !== undefined)
|
|
|
|
|
{
|
|
|
|
|
const id = UUID.fromXMLJS(shape, 'SculptTexture');
|
|
|
|
|
if (id instanceof UUID)
|
|
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
if (!go.extraParams)
|
|
|
|
|
{
|
|
|
|
|
go.extraParams = new ExtraParams();
|
|
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
if (type & SculptType.Mesh)
|
|
|
|
|
{
|
|
|
|
|
go.extraParams.setMeshData(type, id);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
go.extraParams.setSculptData(type, id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if (Utils.getFromXMLJS(shape, 'FlexiEntry') !== undefined)
|
|
|
|
|
{
|
|
|
|
|
const flexiSoftness = Utils.getFromXMLJS(shape, 'FlexiSoftness');
|
|
|
|
|
const flexiTension = Utils.getFromXMLJS(shape, 'FlexiTension');
|
|
|
|
|
const flexiDrag = Utils.getFromXMLJS(shape, 'FlexiDrag');
|
|
|
|
|
const flexiGravity = Utils.getFromXMLJS(shape, 'FlexiGravity');
|
|
|
|
|
const flexiWind = Utils.getFromXMLJS(shape, 'FlexiWind');
|
|
|
|
|
const flexiForceX = Utils.getFromXMLJS(shape, 'FlexiForceX');
|
|
|
|
|
const flexiForceY = Utils.getFromXMLJS(shape, 'FlexiForceY');
|
|
|
|
|
const flexiForceZ = Utils.getFromXMLJS(shape, 'FlexiForceZ');
|
2018-11-05 11:45:04 +00:00
|
|
|
if (flexiSoftness !== false &&
|
|
|
|
|
flexiTension !== false &&
|
|
|
|
|
flexiDrag && false &&
|
|
|
|
|
flexiGravity !== false &&
|
|
|
|
|
flexiWind !== false &&
|
|
|
|
|
flexiForceX !== false &&
|
|
|
|
|
flexiForceY !== false &&
|
|
|
|
|
flexiForceZ !== false)
|
|
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
if (!go.extraParams)
|
|
|
|
|
{
|
|
|
|
|
go.extraParams = new ExtraParams();
|
|
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
go.extraParams.setFlexiData(flexiSoftness, flexiTension, flexiDrag, flexiGravity, flexiWind, new Vector3([flexiForceX, flexiForceY, flexiForceZ]));
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if (Utils.getFromXMLJS(shape, 'LightEntry') !== undefined)
|
|
|
|
|
{
|
|
|
|
|
const lightColorR = Utils.getFromXMLJS(shape, 'LightColorR');
|
|
|
|
|
const lightColorG = Utils.getFromXMLJS(shape, 'LightColorG');
|
|
|
|
|
const lightColorB = Utils.getFromXMLJS(shape, 'LightColorB');
|
|
|
|
|
const lightColorA = Utils.getFromXMLJS(shape, 'LightColorA');
|
|
|
|
|
const lightRadius = Utils.getFromXMLJS(shape, 'LightRadius');
|
|
|
|
|
const lightCutoff = Utils.getFromXMLJS(shape, 'LightCutoff');
|
|
|
|
|
const lightFalloff = Utils.getFromXMLJS(shape, 'LightFalloff');
|
|
|
|
|
const lightIntensity = Utils.getFromXMLJS(shape, 'LightIntensity');
|
2018-11-05 11:45:04 +00:00
|
|
|
if (lightColorR !== false &&
|
|
|
|
|
lightColorG !== false &&
|
|
|
|
|
lightColorB !== false &&
|
|
|
|
|
lightColorA !== false &&
|
|
|
|
|
lightRadius !== false &&
|
|
|
|
|
lightCutoff !== false &&
|
|
|
|
|
lightFalloff !== false &&
|
|
|
|
|
lightIntensity !== false)
|
|
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
if (!go.extraParams)
|
|
|
|
|
{
|
|
|
|
|
go.extraParams = new ExtraParams();
|
|
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
go.extraParams.setLightData(
|
|
|
|
|
new Color4(lightColorR, lightColorG, lightColorB, lightColorA),
|
|
|
|
|
lightRadius,
|
|
|
|
|
lightCutoff,
|
|
|
|
|
lightFalloff,
|
|
|
|
|
lightIntensity
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(shape, 'ExtraParams')) !== undefined)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
const buf = Buffer.from(prop, 'base64');
|
|
|
|
|
go.extraParams = ExtraParams.from(buf);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((prop = Utils.getFromXMLJS(obj, 'TaskInventory')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
if (prop.TaskInventoryItem)
|
|
|
|
|
{
|
|
|
|
|
for (const invItemXML of prop.TaskInventoryItem)
|
|
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
const invItem = new InventoryItem(go);
|
2020-01-09 17:53:22 +00:00
|
|
|
let subProp: any;
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'AssetID')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.assetID = subProp;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'BasePermissions')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
invItem.permissions.baseMask = subProp;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'EveryonePermissions')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
invItem.permissions.everyoneMask = subProp;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'GroupPermissions')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
invItem.permissions.groupMask = subProp;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'NextPermissions')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
invItem.permissions.nextOwnerMask = subProp;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'CurrentPermissions')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
invItem.permissions.ownerMask = subProp;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'CreationDate')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
invItem.created = new Date(parseInt(subProp, 10) * 1000);
|
|
|
|
|
}
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'CreatorID')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.permissions.creator = subProp;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'Description')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
invItem.description = String(subProp);
|
2020-01-09 17:53:22 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'Flags')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
invItem.flags = subProp;
|
|
|
|
|
}
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'GroupID')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.permissions.group = subProp;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'InvType')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
invItem.inventoryType = subProp;
|
|
|
|
|
}
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'ItemID')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.itemID = subProp;
|
|
|
|
|
}
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'OldItemID')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.oldItemID = subProp;
|
|
|
|
|
}
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'LastOwnerID')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.permissions.lastOwner = subProp;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if ((subProp = Utils.getFromXMLJS(invItemXML, 'Name')) !== undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
invItem.name = String(subProp);
|
2020-01-09 17:53:22 +00:00
|
|
|
}
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'OwnerID')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.permissions.owner = subProp;
|
|
|
|
|
}
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'ParentID')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.parentID = subProp;
|
|
|
|
|
}
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'ParentPartID')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.parentPartID = subProp;
|
|
|
|
|
}
|
|
|
|
|
if ((subProp = UUID.fromXMLJS(invItemXML, 'PermsGranter')) !== undefined)
|
|
|
|
|
{
|
|
|
|
|
invItem.permsGranter = subProp;
|
|
|
|
|
}
|
|
|
|
|
go.inventory.push(invItem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
return go;
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
static async fromXML(xml: string | any): Promise<GameObject>
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
let result;
|
|
|
|
|
if (typeof xml === 'string')
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
const parsed = await Utils.parseXML(xml);
|
|
|
|
|
if (!parsed['SceneObjectGroup'])
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
throw new Error('SceneObjectGroup not found');
|
|
|
|
|
}
|
|
|
|
|
result = parsed['SceneObjectGroup'];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result = xml;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let rootPartXML;
|
|
|
|
|
if (result['SceneObjectPart'])
|
|
|
|
|
{
|
|
|
|
|
rootPartXML = result['SceneObjectPart'];
|
|
|
|
|
}
|
|
|
|
|
else if (result['RootPart'] && result['RootPart'][0] && result['RootPart'][0]['SceneObjectPart'])
|
|
|
|
|
{
|
|
|
|
|
rootPartXML = result['RootPart'][0]['SceneObjectPart'];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new Error('Root part not found');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const rootPart = GameObject.partFromXMLJS(rootPartXML[0], true);
|
|
|
|
|
rootPart.children = [];
|
|
|
|
|
rootPart.totalChildren = 0;
|
|
|
|
|
if (result['OtherParts'] && Array.isArray(result['OtherParts']) && result['OtherParts'].length > 0)
|
|
|
|
|
{
|
|
|
|
|
const obj = result['OtherParts'][0];
|
|
|
|
|
if (obj['SceneObjectPart'] || obj['Part'])
|
|
|
|
|
{
|
|
|
|
|
if (obj['Part'])
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
for (const part of obj['Part'])
|
|
|
|
|
{
|
|
|
|
|
rootPart.children.push(GameObject.partFromXMLJS(part['SceneObjectPart'][0], false));
|
|
|
|
|
rootPart.totalChildren++;
|
|
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
for (const part of obj['SceneObjectPart'])
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
rootPart.children.push(GameObject.partFromXMLJS(part, false));
|
|
|
|
|
rootPart.totalChildren++;
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return rootPart;
|
|
|
|
|
}
|
2020-01-09 17:53:22 +00:00
|
|
|
|
2020-11-19 16:51:14 +00:00
|
|
|
static async deRezObjects(region: Region, objects: GameObject[], destination: DeRezDestination, transactionID: UUID, destFolder: UUID): Promise<void>
|
|
|
|
|
{
|
|
|
|
|
const msg = new DeRezObjectMessage();
|
|
|
|
|
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: region.agent.agentID,
|
|
|
|
|
SessionID: region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
msg.AgentBlock = {
|
|
|
|
|
GroupID: UUID.zero(),
|
|
|
|
|
Destination: destination,
|
|
|
|
|
DestinationID: destFolder,
|
|
|
|
|
TransactionID: transactionID,
|
|
|
|
|
PacketCount: 1,
|
|
|
|
|
PacketNumber: 1
|
|
|
|
|
};
|
|
|
|
|
msg.ObjectData = [];
|
|
|
|
|
for (const obj of objects)
|
|
|
|
|
{
|
|
|
|
|
msg.ObjectData.push({
|
|
|
|
|
ObjectLocalID: obj.ID
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
const ack = region.circuit.sendMessage(msg, PacketFlags.Reliable);
|
|
|
|
|
return region.circuit.waitForAck(ack, 10000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static takeManyToInventory(region: Region, objects: GameObject[], folder?: InventoryFolder): Promise<InventoryItem>
|
|
|
|
|
{
|
|
|
|
|
const transactionID = UUID.random();
|
|
|
|
|
let enforceFolder = true;
|
|
|
|
|
if (folder === undefined)
|
|
|
|
|
{
|
|
|
|
|
enforceFolder = false;
|
|
|
|
|
folder = region.agent.inventory.getRootFolderMain();
|
|
|
|
|
}
|
|
|
|
|
return new Promise<InventoryItem>((resolve, reject) =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
region.circuit.waitForMessage<UpdateCreateInventoryItemMessage>(Message.UpdateCreateInventoryItem, 10000, (message: UpdateCreateInventoryItemMessage) =>
|
|
|
|
|
{
|
|
|
|
|
for (const inv of message.InventoryData)
|
|
|
|
|
{
|
2020-12-03 13:55:02 +00:00
|
|
|
const name = Utils.BufferToStringSimple(inv.Name);
|
2020-11-19 16:51:14 +00:00
|
|
|
if (name === objects[0].name)
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
return FilterResponse.Finish;
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
}
|
|
|
|
|
return FilterResponse.NoMatch;
|
|
|
|
|
}).then((createInventoryMsg: UpdateCreateInventoryItemMessage) =>
|
|
|
|
|
{
|
|
|
|
|
for (const inv of createInventoryMsg.InventoryData)
|
|
|
|
|
{
|
2020-12-03 13:55:02 +00:00
|
|
|
const name = Utils.BufferToStringSimple(inv.Name);
|
2020-11-19 16:51:14 +00:00
|
|
|
if (name === objects[0].name)
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
const itemID = inv.ItemID;
|
|
|
|
|
region.agent.inventory.fetchInventoryItem(itemID).then((item: InventoryItem | null) =>
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
if (item === null)
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
reject(new Error('Inventory item was unable to be retrieved after take to inventory'));
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (enforceFolder && folder !== undefined && !item.parentID.equals(folder.folderID))
|
|
|
|
|
{
|
|
|
|
|
item.moveToFolder(folder).then(() =>
|
|
|
|
|
{
|
|
|
|
|
resolve(item);
|
|
|
|
|
}).catch((err: Error) =>
|
|
|
|
|
{
|
|
|
|
|
console.error('Error moving item to correct folder');
|
|
|
|
|
console.error(err);
|
|
|
|
|
resolve(item);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
resolve(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((err) =>
|
|
|
|
|
{
|
|
|
|
|
reject(err);
|
|
|
|
|
});
|
|
|
|
|
return;
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
}).catch(() =>
|
|
|
|
|
{
|
|
|
|
|
reject(new Error('Timed out waiting for UpdateCreateInventoryItem'));
|
2018-11-05 11:45:04 +00:00
|
|
|
});
|
2020-11-19 16:51:14 +00:00
|
|
|
if (folder !== undefined)
|
|
|
|
|
{
|
|
|
|
|
GameObject.deRezObjects(region, objects, DeRezDestination.AgentInventoryTake, transactionID, folder.folderID).then(() =>
|
|
|
|
|
{
|
|
|
|
|
}).catch((err) =>
|
|
|
|
|
{
|
|
|
|
|
console.error(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
constructor()
|
|
|
|
|
{
|
|
|
|
|
this.Position = Vector3.getZero();
|
|
|
|
|
this.Rotation = Quaternion.getIdentity();
|
|
|
|
|
this.AngularVelocity = Vector3.getZero();
|
|
|
|
|
this.TreeSpecies = 0;
|
|
|
|
|
this.SoundFlags = 0;
|
|
|
|
|
this.SoundRadius = 1.0;
|
|
|
|
|
this.SoundGain = 1.0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
async waitForTextureUpdate(timeout?: number): Promise<void>
|
2020-11-19 16:51:14 +00:00
|
|
|
{
|
|
|
|
|
return Utils.waitOrTimeOut<void>(this.onTextureUpdate, timeout);
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-09 18:06:49 +00:00
|
|
|
async rezScript(name: string, description: string, perms: PermissionMask = 532480 as PermissionMask): Promise<InventoryItem>
|
2020-11-19 16:51:14 +00:00
|
|
|
{
|
|
|
|
|
const rezScriptMsg = new RezScriptMessage();
|
|
|
|
|
rezScriptMsg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID,
|
|
|
|
|
GroupID: this.region.agent.activeGroupID
|
|
|
|
|
};
|
|
|
|
|
rezScriptMsg.UpdateBlock = {
|
|
|
|
|
ObjectLocalID: this.ID,
|
|
|
|
|
Enabled: true
|
|
|
|
|
};
|
|
|
|
|
const tmpName = uuid.v4();
|
|
|
|
|
const invItem = new InventoryItem(this);
|
|
|
|
|
invItem.itemID = UUID.zero();
|
|
|
|
|
invItem.parentID = this.FullID;
|
|
|
|
|
invItem.permissions.creator = this.region.agent.agentID;
|
|
|
|
|
invItem.permissions.group = UUID.zero();
|
|
|
|
|
invItem.permissions.baseMask = PermissionMask.All;
|
|
|
|
|
invItem.permissions.ownerMask = PermissionMask.All;
|
|
|
|
|
invItem.permissions.groupMask = 0;
|
|
|
|
|
invItem.permissions.everyoneMask = 0;
|
|
|
|
|
invItem.permissions.nextOwnerMask = perms;
|
|
|
|
|
invItem.permissions.groupOwned = false;
|
|
|
|
|
invItem.type = AssetType.LSLText;
|
|
|
|
|
invItem.inventoryType = InventoryType.LSL;
|
|
|
|
|
invItem.flags = 0;
|
|
|
|
|
invItem.salePrice = this.salePrice || 10;
|
|
|
|
|
invItem.saleType = this.saleType || 0;
|
|
|
|
|
invItem.name = tmpName;
|
|
|
|
|
invItem.description = description;
|
|
|
|
|
invItem.created = new Date();
|
|
|
|
|
|
|
|
|
|
rezScriptMsg.InventoryBlock = {
|
|
|
|
|
ItemID: UUID.zero(),
|
|
|
|
|
FolderID: this.FullID,
|
|
|
|
|
CreatorID: this.region.agent.agentID,
|
|
|
|
|
OwnerID: this.region.agent.agentID,
|
|
|
|
|
GroupID: UUID.zero(),
|
|
|
|
|
BaseMask: PermissionMask.All,
|
|
|
|
|
OwnerMask: PermissionMask.All,
|
|
|
|
|
GroupMask: 0,
|
|
|
|
|
EveryoneMask: 0,
|
|
|
|
|
NextOwnerMask: perms,
|
|
|
|
|
GroupOwned: false,
|
|
|
|
|
TransactionID: UUID.zero(),
|
|
|
|
|
Type: AssetType.LSLText,
|
|
|
|
|
InvType: InventoryType.LSL,
|
|
|
|
|
Flags: 0,
|
|
|
|
|
SaleType: this.saleType || 0,
|
|
|
|
|
SalePrice: this.salePrice || 10,
|
|
|
|
|
Name: Utils.StringToBuffer(tmpName),
|
|
|
|
|
Description: Utils.StringToBuffer(description),
|
|
|
|
|
CreationDate: Math.floor(invItem.created.getTime() / 1000),
|
|
|
|
|
CRC: invItem.getCRC()
|
|
|
|
|
};
|
|
|
|
|
await this.region.circuit.waitForAck(this.region.circuit.sendMessage(rezScriptMsg, PacketFlags.Reliable), 10000);
|
|
|
|
|
await this.updateInventory();
|
|
|
|
|
for (const item of this.inventory)
|
|
|
|
|
{
|
|
|
|
|
if (item.name === tmpName)
|
|
|
|
|
{
|
2021-09-22 16:58:06 +01:00
|
|
|
// We are intentionally not waiting for this rename job so that the wait below succeeds
|
2021-09-23 17:14:23 +01:00
|
|
|
item.renameInTask(this, name).then(() =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}).catch(() =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
});
|
2021-09-22 16:58:06 +01:00
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
await this.waitForInventoryUpdate();
|
|
|
|
|
}
|
|
|
|
|
catch (error)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
await this.updateInventory();
|
|
|
|
|
for (const newItem of this.inventory)
|
|
|
|
|
{
|
|
|
|
|
if (newItem.itemID.equals(item.itemID))
|
|
|
|
|
{
|
|
|
|
|
return newItem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
throw new Error('Failed to add script to object');
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-21 13:57:06 +00:00
|
|
|
public async updateInventory(): Promise<void>
|
2020-11-19 16:51:14 +00:00
|
|
|
{
|
2023-11-21 13:57:06 +00:00
|
|
|
if (this.PCode === PCode.Avatar)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-19 16:51:14 +00:00
|
|
|
const req = new RequestTaskInventoryMessage();
|
|
|
|
|
req.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
req.InventoryData = {
|
|
|
|
|
LocalID: this.ID
|
|
|
|
|
};
|
|
|
|
|
this.region.circuit.sendMessage(req, PacketFlags.Reliable);
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.waitForTaskInventory();
|
2020-11-19 16:51:14 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
private async waitForTaskInventory(): Promise<void>
|
2020-11-19 16:51:14 +00:00
|
|
|
{
|
|
|
|
|
const inventory = await this.region.circuit.waitForMessage<ReplyTaskInventoryMessage>(Message.ReplyTaskInventory, 10000, (message: ReplyTaskInventoryMessage): FilterResponse =>
|
|
|
|
|
{
|
|
|
|
|
if (message.InventoryData.TaskID.equals(this.FullID))
|
|
|
|
|
{
|
|
|
|
|
return FilterResponse.Finish;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return FilterResponse.Match;
|
|
|
|
|
}
|
|
|
|
|
});
|
2023-11-21 17:38:50 +00:00
|
|
|
if (inventory.InventoryData.Filename.length === 0)
|
|
|
|
|
{
|
|
|
|
|
// Inventory is empty
|
|
|
|
|
this.inventory = [];
|
2023-11-21 18:11:53 +00:00
|
|
|
this.resolvedInventory = true;
|
2023-11-21 17:38:50 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
|
2023-11-21 17:38:50 +00:00
|
|
|
const fileName = Utils.BufferToStringSimple(inventory.InventoryData.Filename);
|
2020-11-19 16:51:14 +00:00
|
|
|
const file = await this.region.circuit.XferFileDown(fileName, true, false, UUID.zero(), AssetType.Unknown, true);
|
|
|
|
|
this.inventory = [];
|
|
|
|
|
if (file.length === 0)
|
|
|
|
|
{
|
|
|
|
|
if (this.Flags === undefined)
|
|
|
|
|
{
|
|
|
|
|
this.Flags = 0;
|
|
|
|
|
}
|
|
|
|
|
this.Flags = this.Flags | PrimFlags.InventoryEmpty;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const str = file.toString('utf-8');
|
|
|
|
|
const lineObj = {
|
|
|
|
|
lines: str.replace(/\r\n/g, '\n').split('\n'),
|
2023-11-20 20:44:21 +00:00
|
|
|
lineNum: 0,
|
|
|
|
|
pos: 0
|
2020-11-19 16:51:14 +00:00
|
|
|
};
|
|
|
|
|
while (lineObj.lineNum < lineObj.lines.length)
|
|
|
|
|
{
|
2023-11-20 20:44:21 +00:00
|
|
|
const line = Utils.getNotecardLine(lineObj);
|
2020-12-03 13:55:02 +00:00
|
|
|
const result = Utils.parseLine(line);
|
2020-11-19 16:51:14 +00:00
|
|
|
if (result.key !== null)
|
|
|
|
|
{
|
|
|
|
|
switch (result.key)
|
|
|
|
|
{
|
|
|
|
|
case 'inv_object':
|
2020-12-03 13:55:02 +00:00
|
|
|
/*
|
2020-11-19 16:51:14 +00:00
|
|
|
let itemID = UUID.zero();
|
|
|
|
|
let parentID = UUID.zero();
|
|
|
|
|
let name = '';
|
|
|
|
|
let assetType: AssetType = AssetType.Unknown;
|
|
|
|
|
|
|
|
|
|
while (lineObj.lineNum < lineObj.lines.length)
|
|
|
|
|
{
|
|
|
|
|
result = Utils.parseLine(lineObj.lines[lineObj.lineNum++]);
|
|
|
|
|
if (result.key !== null)
|
|
|
|
|
{
|
|
|
|
|
if (result.key === '{')
|
|
|
|
|
{
|
|
|
|
|
// do nothing
|
|
|
|
|
}
|
|
|
|
|
else if (result.key === '}')
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else if (result.key === 'obj_id')
|
|
|
|
|
{
|
|
|
|
|
itemID = new UUID(result.value);
|
|
|
|
|
}
|
|
|
|
|
else if (result.key === 'parent_id')
|
|
|
|
|
{
|
|
|
|
|
parentID = new UUID(result.value);
|
|
|
|
|
}
|
|
|
|
|
else if (result.key === 'type')
|
|
|
|
|
{
|
|
|
|
|
const typeString = result.value as any;
|
|
|
|
|
assetType = parseInt(AssetTypeLL[typeString], 10);
|
|
|
|
|
}
|
|
|
|
|
else if (result.key === 'name')
|
|
|
|
|
{
|
2023-11-29 16:01:50 +00:00
|
|
|
name = result.value.substring(0, result.value.indexOf('|'));
|
2020-11-19 16:51:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name !== 'Contents')
|
|
|
|
|
{
|
|
|
|
|
console.log('TODO: Do something useful with inv_objects')
|
|
|
|
|
}
|
2020-12-03 13:55:02 +00:00
|
|
|
*/
|
2020-11-19 16:51:14 +00:00
|
|
|
break;
|
|
|
|
|
case 'inv_item':
|
2023-11-20 20:44:21 +00:00
|
|
|
this.inventory.push(InventoryItem.fromEmbeddedAsset(lineObj, this, this.region.agent));
|
2020-11-19 16:51:14 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-11-21 18:11:53 +00:00
|
|
|
this.resolvedInventory = true;
|
2020-11-19 16:51:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
hasNameValueEntry(key: string): boolean
|
|
|
|
|
{
|
|
|
|
|
return this.NameValue[key] !== undefined;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getNameValueEntry(key: string): string
|
|
|
|
|
{
|
|
|
|
|
if (this.NameValue[key])
|
|
|
|
|
{
|
|
|
|
|
return this.NameValue[key].value;
|
|
|
|
|
}
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
setIfDefined(def?: number, v?: number): number
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
if (def === undefined)
|
|
|
|
|
{
|
|
|
|
|
def = 0;
|
|
|
|
|
}
|
|
|
|
|
if (v === undefined)
|
|
|
|
|
{
|
|
|
|
|
return def;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return v;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async setShape(PathCurve?: number,
|
|
|
|
|
ProfileCurve?: number,
|
|
|
|
|
PathBegin?: number,
|
|
|
|
|
PathEnd?: number,
|
|
|
|
|
PathScaleX?: number,
|
|
|
|
|
PathScaleY?: number,
|
|
|
|
|
PathShearX?: number,
|
|
|
|
|
PathShearY?: number,
|
|
|
|
|
PathTwist?: number,
|
|
|
|
|
PathTwistBegin?: number,
|
|
|
|
|
PathRadiusOffset?: number,
|
|
|
|
|
PathTaperX?: number,
|
|
|
|
|
PathTaperY?: number,
|
|
|
|
|
PathRevolutions?: number,
|
|
|
|
|
PathSkew?: number,
|
|
|
|
|
ProfileBegin?: number,
|
|
|
|
|
ProfileEnd?: number,
|
2020-12-03 13:55:02 +00:00
|
|
|
ProfileHollow?: number): Promise<void>
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
this.PathCurve = this.setIfDefined(this.PathCurve, PathCurve);
|
|
|
|
|
this.ProfileCurve = this.setIfDefined(this.ProfileCurve, ProfileCurve);
|
|
|
|
|
this.PathBegin = this.setIfDefined(this.PathBegin, PathBegin);
|
|
|
|
|
this.PathEnd = this.setIfDefined(this.PathEnd, PathEnd);
|
|
|
|
|
this.PathScaleX = this.setIfDefined(this.PathScaleX, PathScaleX);
|
|
|
|
|
this.PathScaleY = this.setIfDefined(this.PathScaleY, PathScaleY);
|
|
|
|
|
this.PathShearX = this.setIfDefined(this.PathShearX, PathShearX);
|
|
|
|
|
this.PathShearY = this.setIfDefined(this.PathShearY, PathShearY);
|
|
|
|
|
this.PathTwist = this.setIfDefined(this.PathTwist, PathTwist);
|
|
|
|
|
this.PathTwistBegin = this.setIfDefined(this.PathTwistBegin, PathTwistBegin);
|
|
|
|
|
this.PathRadiusOffset = this.setIfDefined(this.PathRadiusOffset, PathRadiusOffset);
|
|
|
|
|
this.PathTaperX = this.setIfDefined(this.PathTaperX, PathTaperX);
|
|
|
|
|
this.PathTaperY = this.setIfDefined(this.PathTaperY, PathTaperY);
|
|
|
|
|
this.PathRevolutions = this.setIfDefined(this.PathRevolutions, PathRevolutions);
|
|
|
|
|
this.PathSkew = this.setIfDefined(this.PathSkew, PathSkew);
|
|
|
|
|
this.ProfileBegin = this.setIfDefined(this.ProfileBegin, ProfileBegin);
|
|
|
|
|
this.ProfileEnd = this.setIfDefined(this.ProfileEnd, ProfileEnd);
|
|
|
|
|
this.ProfileHollow = this.setIfDefined(this.ProfileHollow, ProfileHollow);
|
|
|
|
|
if (!this.region)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const msg = new ObjectShapeMessage();
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
msg.ObjectData = [
|
|
|
|
|
{
|
|
|
|
|
ObjectLocalID: this.ID,
|
|
|
|
|
PathCurve: this.PathCurve,
|
|
|
|
|
ProfileCurve: this.ProfileCurve,
|
|
|
|
|
PathBegin: Utils.packBeginCut(this.PathBegin),
|
|
|
|
|
PathEnd: Utils.packEndCut(this.PathEnd),
|
|
|
|
|
PathScaleX: Utils.packPathScale(this.PathScaleX),
|
|
|
|
|
PathScaleY: Utils.packPathScale(this.PathScaleY),
|
|
|
|
|
PathShearX: Utils.packPathShear(this.PathShearX),
|
|
|
|
|
PathShearY: Utils.packPathShear(this.PathShearY),
|
|
|
|
|
PathTwist: Utils.packPathTwist(this.PathTwist),
|
|
|
|
|
PathTwistBegin: Utils.packPathTwist(this.PathTwistBegin),
|
|
|
|
|
PathRadiusOffset: Utils.packPathTwist(this.PathRadiusOffset),
|
|
|
|
|
PathTaperX: Utils.packPathTaper(this.PathTaperX),
|
|
|
|
|
PathTaperY: Utils.packPathTaper(this.PathTaperY),
|
|
|
|
|
PathRevolutions: Utils.packPathRevolutions(this.PathRevolutions),
|
|
|
|
|
PathSkew: Utils.packPathTwist(this.PathSkew),
|
|
|
|
|
ProfileBegin: Utils.packBeginCut(this.ProfileBegin),
|
|
|
|
|
ProfileEnd: Utils.packEndCut(this.ProfileEnd),
|
|
|
|
|
ProfileHollow: Utils.packProfileHollow(this.ProfileHollow)
|
|
|
|
|
}
|
|
|
|
|
];
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.region.circuit.waitForAck(this.region.circuit.sendMessage(msg, PacketFlags.Reliable), 10000);
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
async setName(name: string): Promise<void>
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
this.name = name;
|
|
|
|
|
if (!this.region)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const msg = new ObjectNameMessage();
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
msg.ObjectData = [
|
|
|
|
|
{
|
|
|
|
|
LocalID: this.ID,
|
|
|
|
|
Name: Utils.StringToBuffer(name)
|
|
|
|
|
}
|
|
|
|
|
];
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.region.circuit.waitForAck(this.region.circuit.sendMessage(msg, PacketFlags.Reliable), 10000);
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
async setGeometry(pos?: Vector3, rot?: Quaternion, scale?: Vector3, wholeLinkset: boolean = false): Promise<void>
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
const data = [];
|
2020-11-19 16:51:14 +00:00
|
|
|
const linked = (wholeLinkset) ? UpdateType.Linked : 0;
|
2018-11-15 03:10:14 +00:00
|
|
|
if (pos !== undefined)
|
|
|
|
|
{
|
|
|
|
|
this.Position = pos;
|
|
|
|
|
data.push({
|
|
|
|
|
ObjectLocalID: this.ID,
|
2020-11-19 16:51:14 +00:00
|
|
|
Type: UpdateType.Position | linked,
|
2018-11-15 03:10:14 +00:00
|
|
|
Data: pos.getBuffer()
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (rot !== undefined)
|
|
|
|
|
{
|
|
|
|
|
this.Rotation = rot;
|
|
|
|
|
data.push({
|
|
|
|
|
ObjectLocalID: this.ID,
|
2020-11-19 16:51:14 +00:00
|
|
|
Type: UpdateType.Rotation | linked,
|
2018-11-15 03:10:14 +00:00
|
|
|
Data: rot.getBuffer()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (scale !== undefined)
|
|
|
|
|
{
|
|
|
|
|
this.Scale = scale;
|
|
|
|
|
data.push({
|
|
|
|
|
ObjectLocalID: this.ID,
|
2020-11-19 16:51:14 +00:00
|
|
|
Type: UpdateType.Scale | linked,
|
2018-11-15 03:10:14 +00:00
|
|
|
Data: scale.getBuffer()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (!this.region || data.length === 0)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const msg = new MultipleObjectUpdateMessage();
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
msg.ObjectData = data;
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.region.circuit.waitForAck(this.region.circuit.sendMessage(msg, PacketFlags.Reliable), 30000);
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
linkTo(rootObj: GameObject): Promise<void>
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
const msg = new ObjectLinkMessage();
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
msg.ObjectData = [
|
|
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
ObjectLocalID: rootObj.ID
|
2018-11-15 03:10:14 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
ObjectLocalID: this.ID
|
|
|
|
|
}
|
|
|
|
|
];
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.region.circuit.waitForAck(this.region.circuit.sendMessage(msg, PacketFlags.Reliable), 30000);
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
2020-11-19 16:51:14 +00:00
|
|
|
async linkFrom(objects: GameObject[]): Promise<void>
|
2020-01-07 21:01:20 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
return new Promise<void>((resolve, reject) =>
|
|
|
|
|
{
|
|
|
|
|
if (objects.length === 0)
|
2020-01-07 21:01:20 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
resolve();
|
|
|
|
|
return;
|
2020-01-07 21:01:20 +00:00
|
|
|
}
|
2021-09-23 17:21:36 +01:00
|
|
|
const primsExpectingUpdate: { [key: number]: GameObject } = {};
|
2020-11-19 16:51:14 +00:00
|
|
|
const msg = new ObjectLinkMessage();
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
msg.ObjectData = [
|
|
|
|
|
{
|
|
|
|
|
ObjectLocalID: this.ID
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
primsExpectingUpdate[this.ID] = this;
|
|
|
|
|
for (const obj of objects)
|
2020-01-07 21:01:20 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
msg.ObjectData.push(
|
|
|
|
|
{
|
|
|
|
|
ObjectLocalID: obj.ID
|
|
|
|
|
});
|
|
|
|
|
primsExpectingUpdate[obj.ID] = obj;
|
|
|
|
|
}
|
|
|
|
|
this.region.circuit.waitForMessage<ObjectUpdateMessage>(Message.ObjectUpdate, 10000, (message: ObjectUpdateMessage) =>
|
|
|
|
|
{
|
|
|
|
|
let match = false;
|
|
|
|
|
for (const obj of message.ObjectData)
|
|
|
|
|
{
|
|
|
|
|
const num = obj.ID;
|
|
|
|
|
if (primsExpectingUpdate[num] !== undefined)
|
|
|
|
|
{
|
|
|
|
|
delete primsExpectingUpdate[num];
|
|
|
|
|
match = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (match)
|
|
|
|
|
{
|
|
|
|
|
if (Object.keys(primsExpectingUpdate).length === 0)
|
|
|
|
|
{
|
|
|
|
|
return FilterResponse.Finish;
|
|
|
|
|
}
|
|
|
|
|
return FilterResponse.Match;
|
|
|
|
|
}
|
|
|
|
|
return FilterResponse.NoMatch;
|
2020-12-03 13:55:02 +00:00
|
|
|
}).then(() =>
|
2020-11-19 16:51:14 +00:00
|
|
|
{
|
|
|
|
|
resolve();
|
|
|
|
|
}).catch((err) =>
|
|
|
|
|
{
|
|
|
|
|
reject(err);
|
2020-01-07 21:01:20 +00:00
|
|
|
});
|
2020-11-19 16:51:14 +00:00
|
|
|
this.region.circuit.sendMessage(msg, PacketFlags.Reliable);
|
|
|
|
|
});
|
|
|
|
|
|
2020-01-07 21:01:20 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
async setDescription(desc: string): Promise<void>
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
this.description = desc;
|
|
|
|
|
if (!this.region)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const msg = new ObjectDescriptionMessage();
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
msg.ObjectData = [
|
|
|
|
|
{
|
|
|
|
|
LocalID: this.ID,
|
|
|
|
|
Description: Utils.StringToBuffer(desc)
|
|
|
|
|
}
|
|
|
|
|
];
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.region.circuit.waitForAck(this.region.circuit.sendMessage(msg, PacketFlags.Reliable), 10000);
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
async setTextureEntry(e: TextureEntry): Promise<void>
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
this.TextureEntry = e;
|
|
|
|
|
if (!this.region)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.setTextureAndMediaURL();
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
setTextureAndMediaURL(): Promise<void>
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
const msg = new ObjectImageMessage();
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
if (this.MediaURL === undefined)
|
|
|
|
|
{
|
|
|
|
|
this.MediaURL = '';
|
|
|
|
|
}
|
|
|
|
|
if (this.TextureEntry === undefined)
|
|
|
|
|
{
|
|
|
|
|
this.TextureEntry = new TextureEntry();
|
|
|
|
|
}
|
|
|
|
|
msg.ObjectData = [
|
|
|
|
|
{
|
|
|
|
|
ObjectLocalID: this.ID,
|
|
|
|
|
TextureEntry: this.TextureEntry.toBuffer(),
|
|
|
|
|
MediaURL: Utils.StringToBuffer(this.MediaURL)
|
|
|
|
|
}
|
|
|
|
|
];
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.region.circuit.waitForAck(this.region.circuit.sendMessage(msg, PacketFlags.Reliable), 10000);
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
async setExtraParams(ex: ExtraParams): Promise<void>
|
2018-11-15 03:10:14 +00:00
|
|
|
{
|
|
|
|
|
this.extraParams = ex;
|
|
|
|
|
if (!this.region)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set ExtraParams
|
|
|
|
|
const msg = new ObjectExtraParamsMessage();
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
msg.ObjectData = [];
|
|
|
|
|
let params = 0;
|
|
|
|
|
if (ex.lightData !== null)
|
|
|
|
|
{
|
|
|
|
|
params++;
|
|
|
|
|
const data = ex.lightData.getBuffer();
|
|
|
|
|
msg.ObjectData.push({
|
|
|
|
|
ObjectLocalID: this.ID,
|
|
|
|
|
ParamType: ExtraParamType.Light,
|
|
|
|
|
ParamInUse: (ex.lightData.Intensity !== 0.0),
|
|
|
|
|
ParamData: data,
|
|
|
|
|
ParamSize: data.length
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (ex.flexibleData !== null)
|
|
|
|
|
{
|
|
|
|
|
params++;
|
|
|
|
|
const data = ex.flexibleData.getBuffer();
|
|
|
|
|
msg.ObjectData.push({
|
|
|
|
|
ObjectLocalID: this.ID,
|
|
|
|
|
ParamType: ExtraParamType.Flexible,
|
|
|
|
|
ParamInUse: true,
|
|
|
|
|
ParamData: data,
|
|
|
|
|
ParamSize: data.length
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (ex.lightImageData !== null)
|
|
|
|
|
{
|
|
|
|
|
params++;
|
|
|
|
|
const data = ex.lightImageData.getBuffer();
|
|
|
|
|
msg.ObjectData.push({
|
|
|
|
|
ObjectLocalID: this.ID,
|
|
|
|
|
ParamType: ExtraParamType.LightImage,
|
|
|
|
|
ParamInUse: true,
|
|
|
|
|
ParamData: data,
|
|
|
|
|
ParamSize: data.length
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (ex.sculptData !== null)
|
|
|
|
|
{
|
|
|
|
|
params++;
|
|
|
|
|
const data = ex.sculptData.getBuffer();
|
|
|
|
|
msg.ObjectData.push({
|
|
|
|
|
ObjectLocalID: this.ID,
|
|
|
|
|
ParamType: ExtraParamType.Sculpt,
|
|
|
|
|
ParamInUse: true,
|
|
|
|
|
ParamData: data,
|
|
|
|
|
ParamSize: data.length
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (ex.meshData !== null)
|
|
|
|
|
{
|
|
|
|
|
params++;
|
|
|
|
|
const data = ex.meshData.getBuffer();
|
|
|
|
|
msg.ObjectData.push({
|
|
|
|
|
ObjectLocalID: this.ID,
|
|
|
|
|
ParamType: ExtraParamType.Mesh,
|
|
|
|
|
ParamInUse: true,
|
|
|
|
|
ParamData: data,
|
|
|
|
|
ParamSize: data.length
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (params > 0)
|
|
|
|
|
{
|
|
|
|
|
const ack = this.region.circuit.sendMessage(msg, PacketFlags.Reliable);
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.region.circuit.waitForAck(ack, 10000);
|
2018-11-15 03:10:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
private async getInventoryXML(xml: XMLNode, inv: InventoryItem): Promise<void>
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
if (!inv.assetID.isZero() || !inv.itemID.isZero())
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
|
|
|
|
const item = xml.ele('TaskInventoryItem');
|
2020-11-19 16:51:14 +00:00
|
|
|
|
|
|
|
|
if (inv.inventoryType === InventoryType.Object && inv.assetID.isZero())
|
|
|
|
|
{
|
|
|
|
|
inv.assetID = inv.itemID;
|
|
|
|
|
}
|
|
|
|
|
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
UUID.getXML(item.ele('AssetID'), inv.assetID);
|
|
|
|
|
UUID.getXML(item.ele('ItemID'), inv.itemID);
|
2020-11-19 16:51:14 +00:00
|
|
|
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
if (inv.permissions)
|
|
|
|
|
{
|
|
|
|
|
item.ele('BasePermissions', inv.permissions.baseMask);
|
|
|
|
|
item.ele('EveryonePermissions', inv.permissions.everyoneMask);
|
|
|
|
|
item.ele('GroupPermissions', inv.permissions.groupMask);
|
|
|
|
|
item.ele('NextPermissions', inv.permissions.nextOwnerMask);
|
|
|
|
|
item.ele('CurrentPermissions', inv.permissions.ownerMask);
|
|
|
|
|
item.ele('PermsMask', 0);
|
|
|
|
|
UUID.getXML(item.ele('CreatorID'), inv.permissions.creator);
|
|
|
|
|
UUID.getXML(item.ele('LastOwnerID'), inv.permissions.lastOwner);
|
|
|
|
|
UUID.getXML(item.ele('OwnerID'), inv.permissions.owner);
|
|
|
|
|
UUID.getXML(item.ele('GroupID'), inv.permissions.group);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
item.ele('CreationDate', inv.created.getTime() / 1000);
|
|
|
|
|
item.ele('Description', inv.description);
|
|
|
|
|
item.ele('InvType', inv.inventoryType);
|
2018-11-05 11:45:04 +00:00
|
|
|
|
|
|
|
|
// For wearables, OpenSim expects flags to include the wearable type
|
2020-11-19 16:51:14 +00:00
|
|
|
if (inv.inventoryType === InventoryType.Wearable && !inv.assetID.isZero())
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
const type = (inv.type === 5 ? HTTPAssets.ASSET_CLOTHING : HTTPAssets.ASSET_BODYPART);
|
|
|
|
|
const data = await this.region.clientCommands.asset.downloadAsset(type, inv.assetID);
|
|
|
|
|
const wearable: LLWearable = new LLWearable(data.toString('utf-8'));
|
|
|
|
|
inv.flags = inv.flags | wearable.type;
|
|
|
|
|
}
|
|
|
|
|
catch (error)
|
|
|
|
|
{
|
|
|
|
|
console.error(error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item.ele('Flags', inv.flags);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
UUID.getXML(item.ele('ParentID'), this.FullID);
|
|
|
|
|
UUID.getXML(item.ele('ParentPartID'), this.FullID);
|
|
|
|
|
item.ele('Type', inv.type);
|
|
|
|
|
item.ele('Name', inv.name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
private async getXML(xml: XMLNode, rootPrim: GameObject, linkNum: number, rootNode?: string): Promise<void>
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
2023-11-21 13:57:06 +00:00
|
|
|
const resolver = this.region?.resolver;
|
|
|
|
|
if (resolver)
|
2020-11-19 16:51:14 +00:00
|
|
|
{
|
2023-11-21 17:51:49 +00:00
|
|
|
if (this.resolvedAt === undefined)
|
|
|
|
|
{
|
2023-11-30 18:55:40 +00:00
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
await resolver.resolveObjects([this], { includeTempObjects: true });
|
|
|
|
|
}
|
|
|
|
|
catch (e: unknown)
|
|
|
|
|
{
|
|
|
|
|
Logger.Error(e);
|
|
|
|
|
}
|
2023-11-21 17:51:49 +00:00
|
|
|
}
|
|
|
|
|
if (!this.resolvedInventory)
|
|
|
|
|
{
|
2023-11-30 18:55:40 +00:00
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
await resolver.getInventory(this);
|
|
|
|
|
}
|
|
|
|
|
catch (e: unknown)
|
|
|
|
|
{
|
|
|
|
|
Logger.Error(e);
|
|
|
|
|
}
|
2023-11-21 17:51:49 +00:00
|
|
|
}
|
|
|
|
|
if (this.calculatedLandImpact === undefined)
|
|
|
|
|
{
|
2023-11-30 18:55:40 +00:00
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
await resolver.getCosts([this]);
|
|
|
|
|
}
|
|
|
|
|
catch (e: unknown)
|
|
|
|
|
{
|
|
|
|
|
Logger.Error(e);
|
|
|
|
|
}
|
2023-11-21 17:51:49 +00:00
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
}
|
2023-11-21 13:57:06 +00:00
|
|
|
|
2020-11-19 16:51:14 +00:00
|
|
|
let root = xml;
|
|
|
|
|
if (rootNode)
|
|
|
|
|
{
|
|
|
|
|
root = xml.ele(rootNode);
|
|
|
|
|
}
|
|
|
|
|
const sceneObjectPart = root.ele('SceneObjectPart').att('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance').att('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
|
2023-11-21 14:33:12 +00:00
|
|
|
sceneObjectPart.ele('AllowedDrop', (this.Flags !== undefined && (this.Flags & PrimFlags.AllowInventoryDrop) === PrimFlags.AllowInventoryDrop) ? 'true' : 'false');
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
UUID.getXML(sceneObjectPart.ele('CreatorID'), this.creatorID);
|
2018-11-05 11:45:04 +00:00
|
|
|
UUID.getXML(sceneObjectPart.ele('FolderID'), this.folderID);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
sceneObjectPart.ele('InventorySerial', this.inventorySerial);
|
|
|
|
|
UUID.getXML(sceneObjectPart.ele('UUID'), this.FullID);
|
|
|
|
|
sceneObjectPart.ele('LocalId', this.ID);
|
|
|
|
|
sceneObjectPart.ele('Name', this.name);
|
|
|
|
|
sceneObjectPart.ele('Material', this.Material);
|
2023-11-10 23:57:26 +00:00
|
|
|
if (this.region)
|
|
|
|
|
{
|
|
|
|
|
sceneObjectPart.ele('RegionHandle', this.region.regionHandle.toString());
|
|
|
|
|
}
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
Vector3.getXML(sceneObjectPart.ele('GroupPosition'), rootPrim.Position);
|
|
|
|
|
if (rootPrim === this)
|
|
|
|
|
{
|
|
|
|
|
Vector3.getXML(sceneObjectPart.ele('OffsetPosition'), Vector3.getZero());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Vector3.getXML(sceneObjectPart.ele('OffsetPosition'), this.Position);
|
|
|
|
|
}
|
|
|
|
|
Quaternion.getXML(sceneObjectPart.ele('RotationOffset'), this.Rotation);
|
|
|
|
|
Vector3.getXML(sceneObjectPart.ele('Velocity'), this.Velocity);
|
|
|
|
|
Vector3.getXML(sceneObjectPart.ele('AngularVelocity'), this.AngularVelocity);
|
|
|
|
|
Vector3.getXML(sceneObjectPart.ele('Acceleration'), this.Acceleration);
|
|
|
|
|
sceneObjectPart.ele('Description', this.description);
|
|
|
|
|
if (this.Text !== undefined && this.Text !== '')
|
|
|
|
|
{
|
|
|
|
|
sceneObjectPart.ele('Text', this.Text);
|
|
|
|
|
}
|
|
|
|
|
if (this.TextColor !== undefined)
|
|
|
|
|
{
|
|
|
|
|
Color4.getXML(sceneObjectPart.ele('Color'), this.TextColor);
|
|
|
|
|
}
|
|
|
|
|
sceneObjectPart.ele('SitName', this.sitName);
|
|
|
|
|
sceneObjectPart.ele('TouchName', this.touchName);
|
|
|
|
|
sceneObjectPart.ele('LinkNum', linkNum);
|
|
|
|
|
sceneObjectPart.ele('ClickAction', this.ClickAction);
|
|
|
|
|
const shape = sceneObjectPart.ele('Shape');
|
|
|
|
|
{
|
|
|
|
|
shape.ele('ProfileCurve', this.ProfileCurve);
|
|
|
|
|
if (this.TextureEntry)
|
|
|
|
|
{
|
2018-11-15 03:10:14 +00:00
|
|
|
shape.ele('TextureEntry', this.TextureEntry.toBase64());
|
2023-11-10 23:57:26 +00:00
|
|
|
|
|
|
|
|
if (this.TextureEntry.gltfMaterialOverrides)
|
|
|
|
|
{
|
2023-11-16 02:03:08 +00:00
|
|
|
const overrideKeys = Array.from(this.TextureEntry.gltfMaterialOverrides.keys());
|
|
|
|
|
const numEntries = overrideKeys.length;
|
|
|
|
|
|
|
|
|
|
if (numEntries > 0)
|
2023-11-10 23:57:26 +00:00
|
|
|
{
|
2023-11-16 02:03:08 +00:00
|
|
|
const buf: Buffer[] = [];
|
|
|
|
|
|
|
|
|
|
const num = Buffer.allocUnsafe(1);
|
|
|
|
|
num.writeUInt8(numEntries, 0);
|
|
|
|
|
buf.push(num)
|
|
|
|
|
for (const overrideKey of overrideKeys)
|
2023-11-10 23:57:26 +00:00
|
|
|
{
|
2023-11-16 02:03:08 +00:00
|
|
|
const override = this.TextureEntry.gltfMaterialOverrides.get(overrideKey);
|
|
|
|
|
if (override === undefined)
|
2023-11-10 23:57:26 +00:00
|
|
|
{
|
2023-11-16 02:03:08 +00:00
|
|
|
continue;
|
2023-11-10 23:57:26 +00:00
|
|
|
}
|
|
|
|
|
|
2023-11-16 02:03:08 +00:00
|
|
|
const header = Buffer.allocUnsafe(3);
|
|
|
|
|
header.writeUInt8(overrideKey, 0);
|
2023-11-10 23:57:26 +00:00
|
|
|
|
2023-11-16 02:03:08 +00:00
|
|
|
const json = override.getFullMaterialJSON();
|
|
|
|
|
header.writeUInt16LE(json.length, 1);
|
|
|
|
|
buf.push(header);
|
|
|
|
|
buf.push(Buffer.from(json, 'utf-8'));
|
2023-11-10 23:57:26 +00:00
|
|
|
}
|
2023-11-16 02:03:08 +00:00
|
|
|
shape.ele('MatOvrd', Buffer.concat(buf).toString('base64'));
|
2023-11-10 23:57:26 +00:00
|
|
|
}
|
|
|
|
|
}
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
if (this.extraParams)
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
2018-11-05 11:45:04 +00:00
|
|
|
shape.ele('ExtraParams', this.extraParams.toBase64());
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
}
|
2018-11-15 03:10:14 +00:00
|
|
|
shape.ele('PathBegin', Utils.packBeginCut(Utils.numberOrZero(this.PathBegin)));
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
shape.ele('PathCurve', this.PathCurve);
|
2018-11-15 03:10:14 +00:00
|
|
|
shape.ele('PathEnd', Utils.packEndCut(Utils.numberOrZero(this.PathEnd)));
|
|
|
|
|
shape.ele('PathRadiusOffset', Utils.packPathTwist(Utils.numberOrZero(this.PathRadiusOffset)));
|
|
|
|
|
shape.ele('PathRevolutions', Utils.packPathRevolutions(Utils.numberOrZero(this.PathRevolutions)));
|
|
|
|
|
shape.ele('PathScaleX', Utils.packPathScale(Utils.numberOrZero(this.PathScaleX)));
|
|
|
|
|
shape.ele('PathScaleY', Utils.packPathScale(Utils.numberOrZero(this.PathScaleY)));
|
|
|
|
|
shape.ele('PathShearX', Utils.packPathShear(Utils.numberOrZero(this.PathShearX)));
|
|
|
|
|
shape.ele('PathShearY', Utils.packPathShear(Utils.numberOrZero(this.PathShearY)));
|
|
|
|
|
shape.ele('PathSkew', Utils.packPathTwist(Utils.numberOrZero(this.PathSkew)));
|
|
|
|
|
shape.ele('PathTaperX', Utils.packPathTaper(Utils.numberOrZero(this.PathTaperX)));
|
|
|
|
|
shape.ele('PathTaperY', Utils.packPathTaper(Utils.numberOrZero(this.PathTaperY)));
|
|
|
|
|
shape.ele('PathTwist', Utils.packPathTwist(Utils.numberOrZero(this.PathTwist)));
|
|
|
|
|
shape.ele('PathTwistBegin', Utils.packPathTwist(Utils.numberOrZero(this.PathTwistBegin)));
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
shape.ele('PCode', this.PCode);
|
2018-11-15 03:10:14 +00:00
|
|
|
shape.ele('ProfileBegin', Utils.packBeginCut(Utils.numberOrZero(this.ProfileBegin)));
|
|
|
|
|
shape.ele('ProfileEnd', Utils.packEndCut(Utils.numberOrZero(this.ProfileEnd)));
|
|
|
|
|
shape.ele('ProfileHollow', Utils.packProfileHollow(Utils.numberOrZero(this.ProfileHollow)));
|
2020-11-19 16:51:14 +00:00
|
|
|
|
|
|
|
|
// This is wrong, but opensim expects it
|
|
|
|
|
const mask = 0xf << 4 >>> 0;
|
|
|
|
|
if (this.State === undefined)
|
|
|
|
|
{
|
|
|
|
|
this.State = 0;
|
|
|
|
|
}
|
|
|
|
|
let state = (((this.State & mask) >>> 4) | ((this.State & ~mask) << 4)) >>> 0;
|
|
|
|
|
state = state | this.attachmentPoint;
|
|
|
|
|
shape.ele('State', state);
|
|
|
|
|
shape.ele('LastAttachPoint', 0);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
|
|
|
|
|
if (this.ProfileCurve)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
const profileShape: ProfileShape = this.ProfileCurve & 0x0F;
|
|
|
|
|
const holeType: HoleType = this.ProfileCurve & 0xF0;
|
|
|
|
|
|
|
|
|
|
shape.ele('ProfileShape', ProfileShape[profileShape]);
|
|
|
|
|
shape.ele('HollowShape', HoleType[holeType]);
|
|
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
if (this.extraParams !== undefined && this.extraParams.meshData !== null)
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
2018-11-05 11:45:04 +00:00
|
|
|
shape.ele('SculptType', this.extraParams.meshData.type);
|
|
|
|
|
UUID.getXML(shape.ele('SculptTexture'), this.extraParams.meshData.meshData);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
shape.ele('SculptEntry', true);
|
|
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
else if (this.extraParams !== undefined && this.extraParams.sculptData !== null)
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
2018-11-05 11:45:04 +00:00
|
|
|
shape.ele('SculptType', this.extraParams.sculptData.type);
|
|
|
|
|
UUID.getXML(shape.ele('SculptTexture'), this.extraParams.sculptData.texture);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
shape.ele('SculptEntry', true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
shape.ele('SculptEntry', false);
|
|
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
if (this.extraParams !== undefined && this.extraParams.flexibleData !== null)
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
2018-11-05 11:45:04 +00:00
|
|
|
shape.ele('FlexiSoftness', this.extraParams.flexibleData.Softness);
|
|
|
|
|
shape.ele('FlexiTension', this.extraParams.flexibleData.Tension);
|
|
|
|
|
shape.ele('FlexiDrag', this.extraParams.flexibleData.Drag);
|
|
|
|
|
shape.ele('FlexiGravity', this.extraParams.flexibleData.Gravity);
|
|
|
|
|
shape.ele('FlexiWind', this.extraParams.flexibleData.Wind);
|
|
|
|
|
shape.ele('FlexiForceX', this.extraParams.flexibleData.Force.x);
|
|
|
|
|
shape.ele('FlexiForceY', this.extraParams.flexibleData.Force.y);
|
|
|
|
|
shape.ele('FlexiForceZ', this.extraParams.flexibleData.Force.z);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
shape.ele('FlexiEntry', true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
shape.ele('FlexiEntry', false);
|
|
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
if (this.extraParams !== undefined && this.extraParams.lightData !== null)
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
2018-11-05 11:45:04 +00:00
|
|
|
shape.ele('LightColorR', this.extraParams.lightData.Color.red);
|
|
|
|
|
shape.ele('LightColorG', this.extraParams.lightData.Color.green);
|
|
|
|
|
shape.ele('LightColorB', this.extraParams.lightData.Color.blue);
|
|
|
|
|
shape.ele('LightColorA', this.extraParams.lightData.Color.alpha);
|
|
|
|
|
shape.ele('LightRadius', this.extraParams.lightData.Radius);
|
|
|
|
|
shape.ele('LightCutoff', this.extraParams.lightData.Cutoff);
|
|
|
|
|
shape.ele('LightFalloff', this.extraParams.lightData.Falloff);
|
|
|
|
|
shape.ele('LightIntensity', this.extraParams.lightData.Intensity);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
shape.ele('LightEntry', true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
shape.ele('LightEntry', false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Vector3.getXML(sceneObjectPart.ele('Scale'), this.Scale);
|
|
|
|
|
sceneObjectPart.ele('ParentID', this.ParentID);
|
|
|
|
|
sceneObjectPart.ele('CreationDate', Math.round((new Date()).getTime() / 1000));
|
|
|
|
|
sceneObjectPart.ele('Category', this.category);
|
2020-11-19 16:51:14 +00:00
|
|
|
if (this.IsAttachment)
|
|
|
|
|
{
|
|
|
|
|
Vector3.getXML(sceneObjectPart.ele('AttachPos'), this.Position);
|
|
|
|
|
}
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
sceneObjectPart.ele('SalePrice', this.salePrice);
|
|
|
|
|
sceneObjectPart.ele('ObjectSaleType', this.saleType);
|
|
|
|
|
sceneObjectPart.ele('OwnershipCost', this.ownershipCost);
|
|
|
|
|
UUID.getXML(sceneObjectPart.ele('GroupID'), this.groupID);
|
|
|
|
|
UUID.getXML(sceneObjectPart.ele('OwnerID'), this.OwnerID);
|
|
|
|
|
UUID.getXML(sceneObjectPart.ele('LastOwnerID'), this.lastOwnerID);
|
|
|
|
|
sceneObjectPart.ele('BaseMask', this.baseMask);
|
|
|
|
|
sceneObjectPart.ele('OwnerMask', this.ownerMask);
|
|
|
|
|
sceneObjectPart.ele('GroupMask', this.groupMask);
|
|
|
|
|
sceneObjectPart.ele('EveryoneMask', this.everyoneMask);
|
|
|
|
|
sceneObjectPart.ele('NextOwnerMask', this.nextOwnerMask);
|
|
|
|
|
const flags = [];
|
|
|
|
|
if (this.Flags !== undefined)
|
|
|
|
|
{
|
|
|
|
|
for (const flag of Object.keys(PrimFlags))
|
|
|
|
|
{
|
|
|
|
|
if (typeof flag === 'string')
|
|
|
|
|
{
|
|
|
|
|
const fl: any = PrimFlags;
|
|
|
|
|
const flagName: string = flag;
|
|
|
|
|
const flagValue: number = fl[flagName];
|
|
|
|
|
if (this.Flags & flagValue)
|
|
|
|
|
{
|
|
|
|
|
flags.push(flagName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sceneObjectPart.ele('Flags', flags.join(' '));
|
2018-11-05 11:45:04 +00:00
|
|
|
if (this.textureAnim)
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
2018-11-05 11:45:04 +00:00
|
|
|
sceneObjectPart.ele('TextureAnimation', this.textureAnim.toBase64());
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
}
|
2018-11-05 11:45:04 +00:00
|
|
|
if (this.Particles)
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
2018-11-05 11:45:04 +00:00
|
|
|
sceneObjectPart.ele('ParticleSystem', this.Particles.toBase64());
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
}
|
|
|
|
|
if (this.physicsShapeType)
|
|
|
|
|
{
|
|
|
|
|
sceneObjectPart.ele('PhysicsShapeType', this.physicsShapeType);
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
if (this.Sound && !this.Sound.isZero())
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
|
|
|
|
UUID.getXML(sceneObjectPart.ele('SoundID'), this.Sound);
|
|
|
|
|
sceneObjectPart.ele('SoundGain', this.SoundGain);
|
|
|
|
|
sceneObjectPart.ele('SoundFlags', this.SoundFlags);
|
|
|
|
|
sceneObjectPart.ele('SoundRadius', this.SoundRadius);
|
|
|
|
|
sceneObjectPart.ele('SoundQueueing', false);
|
|
|
|
|
}
|
|
|
|
|
if (this.inventory && this.inventory.length > 0)
|
|
|
|
|
{
|
|
|
|
|
const inventory = sceneObjectPart.ele('TaskInventory');
|
|
|
|
|
for (const inv of this.inventory)
|
|
|
|
|
{
|
2018-11-05 11:45:04 +00:00
|
|
|
await this.getInventoryXML(inventory, inv);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
populateChildren(): void
|
2020-11-19 16:51:14 +00:00
|
|
|
{
|
|
|
|
|
this.region.objects.populateChildren(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async exportXMLElement(rootNode?: string): Promise<XMLElement>
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
{
|
|
|
|
|
const document = builder.create('SceneObjectGroup');
|
|
|
|
|
let linkNum = 1;
|
2020-11-19 16:51:14 +00:00
|
|
|
await this.getXML(document, this, linkNum, rootNode);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
if (this.children && this.children.length > 0)
|
|
|
|
|
{
|
|
|
|
|
const otherParts = document.ele('OtherParts');
|
|
|
|
|
for (const child of this.children)
|
|
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
await child.getXML(otherParts, this, ++linkNum, (rootNode !== undefined) ? 'Part' : undefined);
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
}
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
return document;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async exportXML(rootNode?: string): Promise<string>
|
|
|
|
|
{
|
2021-09-23 17:21:36 +01:00
|
|
|
return (await this.exportXMLElement(rootNode)).end({ pretty: true, allowEmpty: true });
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public toJSON(): IGameObjectData
|
|
|
|
|
{
|
|
|
|
|
return {
|
|
|
|
|
deleted: this.deleted,
|
|
|
|
|
creatorID: this.creatorID,
|
|
|
|
|
creationDate: this.creationDate,
|
|
|
|
|
baseMask: this.baseMask,
|
|
|
|
|
ownerMask: this.ownerMask,
|
|
|
|
|
groupMask: this.groupMask,
|
|
|
|
|
everyoneMask: this.everyoneMask,
|
|
|
|
|
nextOwnerMask: this.nextOwnerMask,
|
|
|
|
|
ownershipCost: this.ownershipCost,
|
|
|
|
|
saleType: this.saleType,
|
|
|
|
|
salePrice: this.salePrice,
|
|
|
|
|
aggregatePerms: this.aggregatePerms,
|
|
|
|
|
aggregatePermTextures: this.aggregatePermTextures,
|
|
|
|
|
aggregatePermTexturesOwner: this.aggregatePermTexturesOwner,
|
|
|
|
|
category: this.category,
|
|
|
|
|
inventorySerial: this.inventorySerial,
|
|
|
|
|
itemID: this.itemID,
|
|
|
|
|
folderID: this.folderID,
|
|
|
|
|
fromTaskID: this.fromTaskID,
|
|
|
|
|
lastOwnerID: this.lastOwnerID,
|
|
|
|
|
name: this.name,
|
|
|
|
|
description: this.description,
|
|
|
|
|
touchName: this.touchName,
|
|
|
|
|
sitName: this.sitName,
|
|
|
|
|
resolvedAt: this.resolvedAt,
|
2020-11-19 16:51:14 +00:00
|
|
|
resolvedInventory: this.resolvedInventory,
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
totalChildren: this.totalChildren,
|
|
|
|
|
landImpact: this.landImpact,
|
|
|
|
|
calculatedLandImpact: this.calculatedLandImpact,
|
|
|
|
|
physicaImpact: this.physicaImpact,
|
|
|
|
|
resourceImpact: this.resourceImpact,
|
|
|
|
|
linkResourceImpact: this.linkResourceImpact,
|
|
|
|
|
linkPhysicsImpact: this.linkPhysicsImpact,
|
|
|
|
|
limitingType: this.limitingType,
|
|
|
|
|
children: this.children,
|
|
|
|
|
ID: this.ID,
|
|
|
|
|
FullID: this.FullID,
|
|
|
|
|
ParentID: this.ParentID,
|
|
|
|
|
OwnerID: this.OwnerID,
|
|
|
|
|
IsAttachment: this.IsAttachment,
|
|
|
|
|
NameValue: this.NameValue,
|
|
|
|
|
PCode: this.PCode,
|
|
|
|
|
State: this.State,
|
|
|
|
|
CRC: this.CRC,
|
|
|
|
|
Material: this.Material,
|
|
|
|
|
ClickAction: this.ClickAction,
|
|
|
|
|
Scale: this.Scale,
|
|
|
|
|
Flags: this.Flags,
|
|
|
|
|
PathCurve: this.PathCurve,
|
|
|
|
|
ProfileCurve: this.ProfileCurve,
|
|
|
|
|
PathBegin: this.PathBegin,
|
|
|
|
|
PathEnd: this.PathEnd,
|
|
|
|
|
PathScaleX: this.PathScaleX,
|
|
|
|
|
PathScaleY: this.PathScaleY,
|
|
|
|
|
PathShearX: this.PathShearX,
|
|
|
|
|
PathShearY: this.PathShearY,
|
|
|
|
|
PathTwist: this.PathTwist,
|
|
|
|
|
PathTwistBegin: this.PathTwistBegin,
|
|
|
|
|
PathRadiusOffset: this.PathRadiusOffset,
|
|
|
|
|
PathTaperX: this.PathTaperX,
|
|
|
|
|
PathTaperY: this.PathTaperY,
|
|
|
|
|
PathRevolutions: this.PathRevolutions,
|
|
|
|
|
PathSkew: this.PathSkew,
|
|
|
|
|
ProfileBegin: this.ProfileBegin,
|
|
|
|
|
ProfileEnd: this.ProfileEnd,
|
|
|
|
|
ProfileHollow: this.ProfileHollow,
|
|
|
|
|
TextureEntry: this.TextureEntry,
|
|
|
|
|
Text: this.Text,
|
|
|
|
|
TextColor: this.TextColor,
|
|
|
|
|
MediaURL: this.MediaURL,
|
|
|
|
|
JointType: this.JointType,
|
|
|
|
|
JointPivot: this.JointPivot,
|
|
|
|
|
JointAxisOrAnchor: this.JointAxisOrAnchor,
|
|
|
|
|
Position: this.Position,
|
|
|
|
|
Rotation: this.Rotation,
|
|
|
|
|
CollisionPlane: this.CollisionPlane,
|
|
|
|
|
Velocity: this.Velocity,
|
|
|
|
|
Acceleration: this.Acceleration,
|
|
|
|
|
AngularVelocity: this.AngularVelocity,
|
|
|
|
|
TreeSpecies: this.TreeSpecies,
|
|
|
|
|
Sound: this.Sound,
|
|
|
|
|
SoundGain: this.SoundGain,
|
|
|
|
|
SoundFlags: this.SoundFlags,
|
|
|
|
|
SoundRadius: this.SoundRadius,
|
|
|
|
|
Particles: this.Particles,
|
|
|
|
|
density: this.density,
|
|
|
|
|
friction: this.friction,
|
|
|
|
|
gravityMultiplier: this.gravityMultiplier,
|
|
|
|
|
physicsShapeType: this.physicsShapeType,
|
|
|
|
|
restitution: this.restitution
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-03 13:55:02 +00:00
|
|
|
setObjectData(data: Buffer): void
|
2018-11-05 11:45:04 +00:00
|
|
|
{
|
|
|
|
|
let dataPos = 0;
|
|
|
|
|
|
|
|
|
|
// noinspection FallThroughInSwitchStatementJS, TsLint
|
|
|
|
|
switch (data.length)
|
|
|
|
|
{
|
2020-12-03 13:55:02 +00:00
|
|
|
// @ts-ignore
|
2018-11-05 11:45:04 +00:00
|
|
|
case 76:
|
|
|
|
|
// Avatar collision normal;
|
|
|
|
|
this.CollisionPlane = new Vector4(data, dataPos);
|
|
|
|
|
dataPos += 16;
|
2020-12-03 13:55:02 +00:00
|
|
|
/* falls through */
|
2018-11-05 11:45:04 +00:00
|
|
|
case 60:
|
|
|
|
|
// Position
|
|
|
|
|
this.Position = new Vector3(data, dataPos);
|
|
|
|
|
dataPos += 12;
|
|
|
|
|
this.Velocity = new Vector3(data, dataPos);
|
|
|
|
|
dataPos += 12;
|
|
|
|
|
this.Acceleration = new Vector3(data, dataPos);
|
|
|
|
|
dataPos += 12;
|
|
|
|
|
this.Rotation = new Quaternion(data, dataPos);
|
|
|
|
|
dataPos += 12;
|
|
|
|
|
this.AngularVelocity = new Vector3(data, dataPos);
|
|
|
|
|
dataPos += 12;
|
|
|
|
|
break;
|
2020-12-03 13:55:02 +00:00
|
|
|
// @ts-ignore
|
2018-11-05 11:45:04 +00:00
|
|
|
case 48:
|
|
|
|
|
this.CollisionPlane = new Vector4(data, dataPos);
|
|
|
|
|
dataPos += 16;
|
2020-12-03 13:55:02 +00:00
|
|
|
/* falls through */
|
2018-11-05 11:45:04 +00:00
|
|
|
case 32:
|
|
|
|
|
this.Position = new Vector3([
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos), -0.5 * 256.0, 1.5 * 256.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 2), -0.5 * 256.0, 1.5 * 256.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 4), -256.0, 3.0 * 256.0)
|
|
|
|
|
]);
|
|
|
|
|
dataPos += 6;
|
|
|
|
|
this.Velocity = new Vector3([
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos), -256.0, 256.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 2), -256.0, 256.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 4), -256.0, 256.0)
|
|
|
|
|
]);
|
|
|
|
|
dataPos += 6;
|
|
|
|
|
this.Acceleration = new Vector3([
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos), -256.0, 256.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 2), -256.0, 256.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 4), -256.0, 256.0)
|
|
|
|
|
]);
|
|
|
|
|
dataPos += 6;
|
|
|
|
|
this.Rotation = new Quaternion([
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos), -1.0, 1.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 2), -1.0, 1.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 4), -1.0, 1.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 4), -1.0, 1.0)
|
|
|
|
|
]);
|
|
|
|
|
dataPos += 8;
|
|
|
|
|
this.AngularVelocity = new Vector3([
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos), -256.0, 256.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 2), -256.0, 256.0),
|
|
|
|
|
Utils.UInt16ToFloat(data.readUInt16LE(dataPos + 4), -256.0, 256.0)
|
|
|
|
|
]);
|
|
|
|
|
dataPos += 6;
|
|
|
|
|
break;
|
|
|
|
|
case 16:
|
|
|
|
|
this.Position = new Vector3([
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0)
|
|
|
|
|
]);
|
|
|
|
|
this.Velocity = new Vector3([
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0)
|
|
|
|
|
]);
|
|
|
|
|
this.Acceleration = new Vector3([
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0)
|
|
|
|
|
]);
|
|
|
|
|
this.Rotation = new Quaternion([
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -1.0, 1.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -1.0, 1.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -1.0, 1.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -1.0, 1.0)
|
|
|
|
|
]);
|
|
|
|
|
this.AngularVelocity = new Vector3([
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0),
|
|
|
|
|
Utils.ByteToFloat(data.readUInt8(dataPos++), -256.0, 256.0)
|
|
|
|
|
]);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-01-09 17:53:22 +00:00
|
|
|
|
2020-11-19 16:51:14 +00:00
|
|
|
async deRezObject(destination: DeRezDestination, transactionID: UUID, destFolder: UUID): Promise<void>
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
return GameObject.deRezObjects(this.region, [this], destination, transactionID, destFolder);
|
2020-01-09 17:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
2020-11-19 16:51:14 +00:00
|
|
|
async takeToInventory(folder?: InventoryFolder): Promise<InventoryItem>
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
return GameObject.takeManyToInventory(this.region, [this], folder);
|
2020-01-09 17:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
2023-11-22 00:42:05 +00:00
|
|
|
async dropInventoryIntoContents(inventoryItem: InventoryItem | UUID): Promise<void>
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
const transactionID = UUID.zero();
|
|
|
|
|
|
|
|
|
|
if (inventoryItem instanceof UUID)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
|
|
|
|
|
const item: InventoryItem | null = await this.region.agent.inventory.fetchInventoryItem(inventoryItem);
|
2020-01-09 17:53:22 +00:00
|
|
|
if (item === null)
|
|
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
throw new Error('Failed to drop inventory into object contents - Inventory item ' + inventoryItem.toString() + ' not found');
|
2020-01-09 17:53:22 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
inventoryItem = item;
|
|
|
|
|
}
|
2020-01-09 17:53:22 +00:00
|
|
|
|
2020-11-19 16:51:14 +00:00
|
|
|
const msg = new UpdateTaskInventoryMessage();
|
|
|
|
|
msg.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
msg.UpdateData = {
|
|
|
|
|
Key: 0,
|
|
|
|
|
LocalID: this.ID
|
|
|
|
|
};
|
|
|
|
|
msg.InventoryData = {
|
|
|
|
|
ItemID: inventoryItem.itemID,
|
|
|
|
|
FolderID: inventoryItem.parentID,
|
|
|
|
|
CreatorID: inventoryItem.permissions.creator,
|
|
|
|
|
OwnerID: inventoryItem.permissions.owner,
|
|
|
|
|
GroupID: inventoryItem.permissions.group,
|
|
|
|
|
BaseMask: inventoryItem.permissions.baseMask,
|
|
|
|
|
OwnerMask: inventoryItem.permissions.ownerMask,
|
|
|
|
|
GroupMask: inventoryItem.permissions.groupMask,
|
|
|
|
|
EveryoneMask: inventoryItem.permissions.everyoneMask,
|
|
|
|
|
NextOwnerMask: inventoryItem.permissions.nextOwnerMask,
|
|
|
|
|
GroupOwned: inventoryItem.permissions.groupOwned || false,
|
|
|
|
|
TransactionID: transactionID,
|
|
|
|
|
Type: inventoryItem.type,
|
|
|
|
|
InvType: inventoryItem.inventoryType,
|
|
|
|
|
Flags: inventoryItem.flags,
|
|
|
|
|
SaleType: inventoryItem.saleType,
|
|
|
|
|
SalePrice: inventoryItem.salePrice,
|
2023-11-22 00:42:05 +00:00
|
|
|
Name: Utils.StringToBuffer(inventoryItem.name),
|
2020-11-19 16:51:14 +00:00
|
|
|
Description: Utils.StringToBuffer(inventoryItem.description),
|
|
|
|
|
CreationDate: inventoryItem.created.getTime() / 1000,
|
|
|
|
|
CRC: inventoryItem.getCRC()
|
|
|
|
|
};
|
|
|
|
|
const serial = this.inventorySerial;
|
|
|
|
|
this.region.circuit.sendMessage(msg, PacketFlags.Reliable);
|
|
|
|
|
return this.waitForInventoryUpdate(serial);
|
|
|
|
|
}
|
2020-01-09 17:53:22 +00:00
|
|
|
|
2020-11-19 16:51:14 +00:00
|
|
|
async waitForInventoryUpdate(inventorySerial?: number): Promise<void>
|
|
|
|
|
{
|
|
|
|
|
// We need to select the object or we won't get the objectProperties message
|
2021-09-22 16:58:06 +01:00
|
|
|
await this.deselect();
|
2020-11-19 16:51:14 +00:00
|
|
|
this.select();
|
|
|
|
|
await this.region.circuit.waitForMessage<ObjectPropertiesMessage>(Message.ObjectProperties, 10000, (message: ObjectPropertiesMessage) =>
|
|
|
|
|
{
|
|
|
|
|
for (const obj of message.ObjectData)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
if (obj.ObjectID.equals(this.FullID))
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
if (inventorySerial === undefined)
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
2020-11-19 16:51:14 +00:00
|
|
|
inventorySerial = this.inventorySerial;
|
|
|
|
|
}
|
|
|
|
|
if (obj.InventorySerial > inventorySerial)
|
|
|
|
|
{
|
|
|
|
|
return FilterResponse.Finish;
|
2020-01-09 17:53:22 +00:00
|
|
|
}
|
|
|
|
|
}
|
2020-11-19 16:51:14 +00:00
|
|
|
}
|
|
|
|
|
return FilterResponse.NoMatch;
|
2020-01-09 17:53:22 +00:00
|
|
|
});
|
2020-11-19 16:51:14 +00:00
|
|
|
await this.deselect();
|
2020-01-09 17:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
select(): Promise<void>
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
const selectObject = new ObjectSelectMessage();
|
|
|
|
|
selectObject.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
selectObject.ObjectData = [{
|
|
|
|
|
ObjectLocalID: this.ID
|
|
|
|
|
}];
|
|
|
|
|
const ack = this.region.circuit.sendMessage(selectObject, PacketFlags.Reliable);
|
2020-12-03 13:55:02 +00:00
|
|
|
return this.region.circuit.waitForAck(ack, 10000);
|
2020-01-09 17:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
deselect(): Promise<void>
|
2020-01-09 17:53:22 +00:00
|
|
|
{
|
|
|
|
|
const deselectObject = new ObjectDeselectMessage();
|
|
|
|
|
deselectObject.AgentData = {
|
|
|
|
|
AgentID: this.region.agent.agentID,
|
|
|
|
|
SessionID: this.region.circuit.sessionID
|
|
|
|
|
};
|
|
|
|
|
deselectObject.ObjectData = [{
|
|
|
|
|
ObjectLocalID: this.ID
|
|
|
|
|
}];
|
|
|
|
|
const ack = this.region.circuit.sendMessage(deselectObject, PacketFlags.Reliable);
|
2020-11-19 16:51:14 +00:00
|
|
|
return this.region.circuit.waitForAck(ack, 10000);
|
2020-01-09 17:53:22 +00:00
|
|
|
}
|
- Add "GET" method to Caps
- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit
PUBLIC API:
AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs
RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
2018-10-31 11:28:24 +00:00
|
|
|
}
|