See <ComponentProps>
A portion of the configuration object to pass to the NetworkRigidbodyComponent
constructor.
type NetworkRigidbodyComponentPropsV1 = {
position?: Position | undefined;
rotation?: Rotation | undefined;
isKinematic?: boolean | undefined;
isServerSleeping?: boolean | undefined;
velocity?: Velocity | undefined;
angularVelocity?: AngularVelocity | undefined;
};
type NetworkRigidbodyComponentProps = NetworkRigidbodyComponentPropsV1;
position
(optional, default{ x: 0, y: 0, z: 0 }
)<Position>
rotation
(optional, default{ x: 0, y: 0, z: 0, w: 1 }
)<Rotation>
isKinematic
(optional, defaultfalse
)<boolean>
isServerSleeping
(optional, defaultfalse
)<boolean>
velocity
(optional, default{ x: 0, y: 0, z: 0 }
)<Velocity>
angularVelocity
(optional, default{ x: 0, y: 0, z: 0 }
)<AngularVelocity>
Creates a versioned NetworkRigidbody
component.
props
<ComponentProps & NetworkRigidbodyComponentProps>
Configuration of the component to create.- Returns:
<NetworkRigidbodyComponent>
import { NetworkRigidbodyComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new NetworkRigidbodyComponent({ version: componentVersion });
See Component.fromBinary(reader, version)
Note that the following properties are sorted in order of appearance when decoding component binary data.
See Component.hash
See Component.name
Position of the prefab this component is attached to.
- Since:
v1
<Position>
import { NetworkRigidbodyComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new NetworkRigidbodyComponent({ version: componentVersion });
const position = component.position;
// `position` is `{ x: 0, y: 0, z: 0 }`
Rotation of the prefab this component is attached to.
- Since:
v1
<Rotation>
import { NetworkRigidbodyComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new NetworkRigidbodyComponent({ version: componentVersion });
const rotation = component.rotation;
// `rotation` is `{ x: 0, y: 0, z: 0, w: 1 }`
Whether the prefab this component is attached to is kinematic or not.
- Since:
v1
<boolean>
import { NetworkRigidbodyComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new NetworkRigidbodyComponent({ version: componentVersion });
const isKinematic = component.isKinematic;
// `isKinematic` is `false`
Whether the prefab this component is attached to is sleeping or not.
- Since:
v1
<boolean>
import { NetworkRigidbodyComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new NetworkRigidbodyComponent({ version: componentVersion });
const isServerSleeping = component.isServerSleeping;
// `isServerSleeping` is `false`
Velocity of the prefab this component is attached to.
- Since:
v1
<Velocity>
import { NetworkRigidbodyComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new NetworkRigidbodyComponent({ version: componentVersion });
const velocity = component.velocity;
// `velocity` is `{ x: 0, y: 0, z: 0 }`
Angular velocity of the prefab this component is attached to.
- Since:
v1
<AngularVelocity>
import { NetworkRigidbodyComponent } from 'att-string-transcoder';
const componentVersion = 1;
const component = new NetworkRigidbodyComponent({ version: componentVersion });
const angularVelocity = component.angularVelocity;
// `angularVelocity` is `{ x: 0, y: 0, z: 0 }`
See Component.toBinary(version?)