2018-10-16 16:46:58 +01:00
|
|
|
import {UUID} from './UUID';
|
|
|
|
|
import {Color4} from './Color4';
|
|
|
|
|
import {TextureFlags} from '../enums/TextureFlags';
|
- 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 {Bumpiness} from '../enums/Bumpiness';
|
|
|
|
|
import {Shininess} from '../enums/Shininess';
|
|
|
|
|
import {MappingType} from '../enums/MappingType';
|
2018-10-16 16:46:58 +01:00
|
|
|
|
|
|
|
|
export class TextureEntryFace
|
|
|
|
|
{
|
- 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
|
|
|
static BUMP_MASK = 0x1F;
|
|
|
|
|
static FULLBRIGHT_MASK = 0x20;
|
|
|
|
|
static SHINY_MASK = 0xC0;
|
|
|
|
|
static MEDIA_MASK = 0x01;
|
|
|
|
|
static TEX_MAP_MASK = 0x06;
|
2018-10-16 16:46:58 +01:00
|
|
|
|
|
|
|
|
textureID: UUID;
|
|
|
|
|
rgba: Color4;
|
|
|
|
|
repeatU: number;
|
|
|
|
|
repeatV: number;
|
|
|
|
|
offsetU: number;
|
|
|
|
|
offsetV: number;
|
|
|
|
|
rotation: number;
|
|
|
|
|
glow: number;
|
|
|
|
|
materialID: UUID;
|
- 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
|
|
|
bumpiness: Bumpiness = Bumpiness.None;
|
|
|
|
|
shininess: Shininess = Shininess.None;
|
|
|
|
|
mappingType: MappingType = MappingType.Default;
|
|
|
|
|
fullBright = false;
|
|
|
|
|
mediaFlags = false;
|
2018-10-16 16:46:58 +01: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
|
|
|
private materialb: number;
|
|
|
|
|
private mediab: number;
|
2018-10-16 16:46:58 +01:00
|
|
|
private hasAttribute: TextureFlags;
|
|
|
|
|
private defaultTexture: TextureEntryFace | null;
|
|
|
|
|
|
|
|
|
|
constructor(def: TextureEntryFace | null)
|
|
|
|
|
{
|
|
|
|
|
this.rgba = Color4.white;
|
|
|
|
|
this.repeatU = 1.0;
|
|
|
|
|
this.repeatV = 1.0;
|
|
|
|
|
this.defaultTexture = def;
|
|
|
|
|
if (this.defaultTexture == null)
|
|
|
|
|
{
|
|
|
|
|
this.hasAttribute = TextureFlags.All;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.hasAttribute = TextureFlags.None;
|
|
|
|
|
}
|
|
|
|
|
}
|
- 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
|
|
|
|
|
|
|
|
get material(): number
|
|
|
|
|
{
|
|
|
|
|
return this.materialb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set material(material: number)
|
|
|
|
|
{
|
|
|
|
|
this.materialb = material;
|
|
|
|
|
if ((this.hasAttribute & TextureFlags.Material) !== 0)
|
|
|
|
|
{
|
|
|
|
|
this.bumpiness = this.materialb & TextureEntryFace.BUMP_MASK;
|
|
|
|
|
this.shininess = this.materialb & TextureEntryFace.SHINY_MASK;
|
|
|
|
|
this.fullBright = ((this.materialb & TextureEntryFace.FULLBRIGHT_MASK) !== 0);
|
|
|
|
|
}
|
|
|
|
|
else if (this.defaultTexture !== null)
|
|
|
|
|
{
|
|
|
|
|
this.bumpiness = this.defaultTexture.bumpiness;
|
|
|
|
|
this.shininess = this.defaultTexture.shininess;
|
|
|
|
|
this.fullBright = this.defaultTexture.fullBright;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get media(): number
|
|
|
|
|
{
|
|
|
|
|
return this.mediab;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set media(media: number)
|
|
|
|
|
{
|
|
|
|
|
this.mediab = media;
|
|
|
|
|
if ((this.hasAttribute & TextureFlags.Media) !== 0)
|
|
|
|
|
{
|
|
|
|
|
this.mappingType = media & TextureEntryFace.TEX_MAP_MASK;
|
|
|
|
|
this.mediaFlags = ((media & TextureEntryFace.MEDIA_MASK) !== 0);
|
|
|
|
|
}
|
|
|
|
|
else if (this.defaultTexture !== null)
|
|
|
|
|
{
|
|
|
|
|
this.mappingType = this.defaultTexture.mappingType;
|
|
|
|
|
this.mediaFlags = this.defaultTexture.mediaFlags;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new Error('No media attribute and default texture is null');
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-10-16 16:46:58 +01:00
|
|
|
}
|