Skip to content

Commit 18373fd

Browse files
Add AttachedRot and AttachedPos xml serialization
1 parent 070a2ec commit 18373fd

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

lib/classes/public/GameObject.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ export class GameObject implements IGameObjectData
150150
public JointAxisOrAnchor?: Vector3;
151151
public Position?: Vector3;
152152
public Rotation?: Quaternion;
153+
public AttachedPos?: Vector3;
154+
public AttachedRot?: Quaternion;
153155
public CollisionPlane?: Vector4;
154156
public Velocity?: Vector3;
155157
public Acceleration?: Vector3;
@@ -1381,6 +1383,14 @@ export class GameObject implements IGameObjectData
13811383
{
13821384
go.Rotation = prop;
13831385
}
1386+
if ((prop = Vector3.fromXMLJS(obj, 'AttachedPos')) !== undefined)
1387+
{
1388+
go.AttachedPos = prop;
1389+
}
1390+
if ((prop = Quaternion.fromXMLJS(obj, 'AttachedRot')) !== undefined)
1391+
{
1392+
go.AttachedRot = prop;
1393+
}
13841394
if ((prop = Vector3.fromXMLJS(obj, 'Velocity')) !== undefined)
13851395
{
13861396
go.Velocity = prop;
@@ -2091,6 +2101,14 @@ export class GameObject implements IGameObjectData
20912101
Vector3.getXML(sceneObjectPart.ele('OffsetPosition'), this.Position);
20922102
}
20932103
Quaternion.getXML(sceneObjectPart.ele('RotationOffset'), this.Rotation);
2104+
if (this.AttachedPos !== undefined)
2105+
{
2106+
Vector3.getXML(sceneObjectPart.ele('AttachedPos'), this.AttachedPos);
2107+
}
2108+
if (this.AttachedRot !== undefined)
2109+
{
2110+
Quaternion.getXML(sceneObjectPart.ele('AttachedRot'), this.AttachedRot);
2111+
}
20942112
Vector3.getXML(sceneObjectPart.ele('Velocity'), this.Velocity);
20952113
Vector3.getXML(sceneObjectPart.ele('AngularVelocity'), this.AngularVelocity);
20962114
Vector3.getXML(sceneObjectPart.ele('Acceleration'), this.Acceleration);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@caspertech/node-metaverse",
3-
"version": "0.8.9",
3+
"version": "0.8.10",
44
"description": "A node.js interface for Second Life.",
55
"main": "dist/lib/index.js",
66
"types": "dist/lib/index.d.ts",

0 commit comments

Comments
 (0)