This is an old revision of the document!


/api/asset/setlocation

Usage

This function is used to set the physical location of an asset.

You can set any combination of position, rotation and scale. The values must be made up of three floating-point numbers.

For position and scale, these are measured in your world units (normally feet or meters) in X,Y & Z, and the rotation is measured in degrees in Roll, Pitch and Yaw.

Note: Although the term used is 'scale', this represents the size of the object in world coordinates. A scale of 2,2,2 is a 2m x 2m x 2m cube, not double the size of the original model.

Details

DetailValue
GroupAsset
From Server Version0.9.0
PermissionGuest
MethodsGET or POST
Parameters
ParameterNotesMeaning
idNumber [Required]The ID of the asset
positionString [Optional]Location in X,Y,Z
scaleString [Optional]Size in X,Y,Z
rotationString [Optional]Rotation in Roll,Pitch,Yaw (Degrees)
offsetString [Optional]Offset from Reference

Offset Values

Some assets base their position off other assets. For example, the wheels of a car are often based off the position of the car itself, the position of a train based on the railway.

By providing values for offset, you modify where the asset is relative to the parent object.

The offset value contains six elements in the following format…

X,Y,Z|Roll,Pitch,Yaw

This provides both the distance away the asset is, and the relative orientation.

Examples

Call
http://ardiserver.com/api/asset/setlocation?id=5&property=10&position=10,0,0

This moves the object to 10m to the right of the center of the world.

http://ardiserver.com/api/asset/setlocation?id=5&property=10&position=10,0,0&rotation=0,90,0

This moves it, then flips it up on its side.

http://ardiserver.com/api/asset/setlocation?id=5&property=10&offset=5,0,0|0,90,0

This moves the object 5m out from and pitches it up 90 degrees relative to its parent.