2020-01-06 12:10:40 +00:00
|
|
|
import { UUID } from '../UUID';
|
|
|
|
|
import { Vector4 } from '../Vector4';
|
|
|
|
|
import { Color4 } from '../Color4';
|
|
|
|
|
import { Vector2 } from '../Vector2';
|
|
|
|
|
import { SkyPreset } from './interfaces/SkyPreset';
|
|
|
|
|
import { WaterPreset } from './interfaces/WaterPreset';
|
|
|
|
|
import { XMLNode } from 'xmlbuilder';
|
- 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 RegionEnvironment
|
|
|
|
|
{
|
|
|
|
|
regionID: UUID;
|
|
|
|
|
dayCycleKeyframes: {
|
|
|
|
|
time: number,
|
|
|
|
|
preset: string
|
|
|
|
|
}[];
|
|
|
|
|
skyPresets: {
|
|
|
|
|
[key: string]: SkyPreset
|
|
|
|
|
} = {};
|
|
|
|
|
water: WaterPreset;
|
|
|
|
|
|
2021-09-23 17:14:23 +01:00
|
|
|
getXML(xml: XMLNode): 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
|
|
|
{
|
|
|
|
|
const env = xml.ele('Environment');
|
|
|
|
|
const dayCycle = env.ele('DayCycle');
|
|
|
|
|
for (const keyFrame of this.dayCycleKeyframes)
|
|
|
|
|
{
|
|
|
|
|
const kf = dayCycle.ele('KeyFrame');
|
|
|
|
|
kf.ele('Time', keyFrame.time);
|
|
|
|
|
kf.ele('Preset', keyFrame.preset);
|
|
|
|
|
}
|
|
|
|
|
const skyPresets = env.ele('SkyPresets');
|
|
|
|
|
for (const presetKey of Object.keys(this.skyPresets))
|
|
|
|
|
{
|
|
|
|
|
const preset = this.skyPresets[presetKey];
|
|
|
|
|
const pre = skyPresets.ele('Preset');
|
|
|
|
|
pre.att('name', presetKey);
|
|
|
|
|
Vector4.getXML(pre.ele('Ambient'), preset.ambient);
|
|
|
|
|
Vector4.getXML(pre.ele('BlueDensity'), preset.blueDensity);
|
|
|
|
|
Vector4.getXML(pre.ele('BlueHorizon'), preset.blueHorizon);
|
|
|
|
|
Color4.getXML(pre.ele('CloudColor'), preset.cloudColor);
|
|
|
|
|
Vector4.getXML(pre.ele('CloudPosDensity1'), preset.cloudPosDensity1);
|
|
|
|
|
Vector4.getXML(pre.ele('CloudPosDensity2'), preset.cloudPosDensity2);
|
|
|
|
|
Vector4.getXML(pre.ele('CloudScale'), preset.cloudScale);
|
|
|
|
|
Vector2.getXML(pre.ele('CloudScrollRate'), preset.cloudScrollRate);
|
|
|
|
|
Vector4.getXML(pre.ele('CloudShadow'), preset.cloudScale);
|
|
|
|
|
Vector4.getXML(pre.ele('DensityMultiplier'), preset.cloudScale);
|
|
|
|
|
Vector4.getXML(pre.ele('DistanceMultiplier'), preset.cloudScale);
|
|
|
|
|
pre.ele('EastAngle', preset.eastAngle);
|
|
|
|
|
const cloudScroll = pre.ele('EnableCloudScroll');
|
|
|
|
|
cloudScroll.ele('X', preset.enableCloudScroll.x);
|
|
|
|
|
cloudScroll.ele('Y', preset.enableCloudScroll.y);
|
|
|
|
|
Vector4.getXML(pre.ele('Gamma'), preset.gamma);
|
|
|
|
|
Vector4.getXML(pre.ele('Glow'), preset.glow);
|
|
|
|
|
Vector4.getXML(pre.ele('HazeDensity'), preset.hazeDensity);
|
|
|
|
|
Vector4.getXML(pre.ele('HazeHorizon'), preset.hazeHorizon);
|
|
|
|
|
Vector4.getXML(pre.ele('LightNormal'), preset.lightNormal);
|
|
|
|
|
Vector4.getXML(pre.ele('MaxY'), preset.maxY);
|
|
|
|
|
pre.ele('StarBrightness', preset.starBrightness);
|
|
|
|
|
pre.ele('SunAngle', preset.sunAngle);
|
|
|
|
|
Color4.getXML(pre.ele('SunLightColor'), preset.sunlightColor);
|
|
|
|
|
}
|
|
|
|
|
const water = env.ele('Water');
|
|
|
|
|
water.ele('BlurMultiplier', this.water.blurMultiplier);
|
|
|
|
|
water.ele('FresnelOffset', this.water.fresnelOffset);
|
|
|
|
|
water.ele('FresnelScale', this.water.fresnelScale);
|
|
|
|
|
UUID.getXML(water.ele('NormalMap'), this.water.normalMap);
|
|
|
|
|
water.ele('ScaleAbove', this.water.scaleAbove);
|
|
|
|
|
water.ele('ScaleBelow', this.water.scaleBelow);
|
|
|
|
|
water.ele('UnderWaterFogMod', this.water.underWaterFogMod);
|
|
|
|
|
Color4.getXML(water.ele('WaterFogColor'), this.water.waterFogColor);
|
|
|
|
|
water.ele('WaterFogDensity', this.water.waterFogDensity);
|
|
|
|
|
Vector2.getXML(water.ele('Wave1Dir'), this.water.wave1Dir);
|
|
|
|
|
Vector2.getXML(water.ele('Wave2Dir'), this.water.wave2Dir);
|
|
|
|
|
}
|
|
|
|
|
}
|