reckfellENGINE

GltfPhysicsBody

Represents a glTF physics body.

On this page
class GltfPhysicsBodyReckfellSharpInherits Resource

Represents a glTF physics body.

Represents a physics body as an intermediary between the OMI_physics_body glTF data and Reckfell's nodes, and it's abstracted in a way that allows adding support for different glTF physics extensions in the future.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

GltfPhysicsBodyConstructor
# GltfPhysicsBody
C#
public GltfPhysicsBody();

Properties8

AngularVelocityProperty
# AngularVelocity
C#
public Vector3 AngularVelocity { get; set; }

The angular velocity of the physics body, in radians per second. This is only used when the body type is "rigid" or "vehicle".

BodyTypeProperty
# BodyType
C#
public string BodyType { get; set; }

The type of the body. When importing, this controls what type of CollisionObject3D node Reckfell should generate. Valid values are "static", "animatable", "character", "rigid", "vehicle", and "trigger". When exporting, this will be squashed down to one of "static", "kinematic", or "dynamic" motion types, or the "trigger" property.

CenterOfMassProperty
# CenterOfMass
C#
public Vector3 CenterOfMass { get; set; }

The center of mass of the body, in meters. This is in local space relative to the body. By default, the center of the mass is the body's origin.

InertiaDiagonalProperty
# InertiaDiagonal
C#
public Vector3 InertiaDiagonal { get; set; }

The inertia strength of the physics body, in kilogram meter squared (kg⋅m²). This represents the inertia around the principle axes, the diagonal of the inertia tensor matrix. This is only used when the body type is "rigid" or "vehicle". When converted to a Reckfell RigidBody3D node, if this value is zero, then the inertia will be calculated automatically.

InertiaOrientationProperty
# InertiaOrientation
C#
public Quaternion InertiaOrientation { get; set; }

The inertia orientation of the physics body. This defines the rotation of the inertia's principle axes relative to the object's local axes. This is only used when the body type is "rigid" or "vehicle" and GltfPhysicsBody.InertiaDiagonal is set to a non-zero value.

InertiaTensorProperty · Deprecated
# InertiaTensor
C#
public Basis InertiaTensor { get; set; }

The inertia tensor of the physics body, in kilogram meter squared (kg⋅m²). This is only used when the body type is "rigid" or "vehicle". When converted to a Reckfell RigidBody3D node, if this value is zero, then the inertia will be calculated automatically.

LinearVelocityProperty
# LinearVelocity
C#
public Vector3 LinearVelocity { get; set; }

The linear velocity of the physics body, in meters per second. This is only used when the body type is "rigid" or "vehicle".

MassProperty
# Mass
C#
public float Mass { get; set; }

The mass of the physics body, in kilograms. This is only used when the body type is "rigid" or "vehicle".

Methods20

FromDictionaryGltfPhysicsBody
# FromDictionary
C#
public static GltfPhysicsBody FromDictionary(Reckfell.Collections.Dictionary dictionary);

Creates a new GLTFPhysicsBody instance by parsing the given Reckfell.Collections.Dictionary in the OMI_physics_body glTF extension format.

Parameters
NameTypeDefault
dictionaryReckfell.Collections.Dictionary—
Returns GltfPhysicsBody
FromNodeGltfPhysicsBody
# FromNode
C#
public static GltfPhysicsBody FromNode(CollisionObject3D bodyNode);

Creates a new GLTFPhysicsBody instance from the given Reckfell CollisionObject3D node.

Parameters
NameTypeDefault
bodyNodeCollisionObject3D—
Returns GltfPhysicsBody
GetAngularVelocityVector3
# GetAngularVelocity
C#
public Vector3 GetAngularVelocity();
Returns Vector3
GetBodyTypestring
# GetBodyType
C#
public string GetBodyType();
Returns string
GetCenterOfMassVector3
# GetCenterOfMass
C#
public Vector3 GetCenterOfMass();
Returns Vector3
GetInertiaDiagonalVector3
# GetInertiaDiagonal
C#
public Vector3 GetInertiaDiagonal();
Returns Vector3
GetInertiaOrientationQuaternion
# GetInertiaOrientation
C#
public Quaternion GetInertiaOrientation();
Returns Quaternion
GetInertiaTensorBasis
# GetInertiaTensor
C#
public Basis GetInertiaTensor();
Returns Basis
GetLinearVelocityVector3
# GetLinearVelocity
C#
public Vector3 GetLinearVelocity();
Returns Vector3
GetMassfloat
# GetMass
C#
public float GetMass();
Returns float
SetAngularVelocityvoid
# SetAngularVelocity
C#
public void SetAngularVelocity(Vector3 angularVelocity);
Parameters
NameTypeDefault
angularVelocityVector3—
SetBodyTypevoid
# SetBodyType
C#
public void SetBodyType(string bodyType);
Parameters
NameTypeDefault
bodyTypestring—
SetCenterOfMassvoid
# SetCenterOfMass
C#
public void SetCenterOfMass(Vector3 centerOfMass);
Parameters
NameTypeDefault
centerOfMassVector3—
SetInertiaDiagonalvoid
# SetInertiaDiagonal
C#
public void SetInertiaDiagonal(Vector3 inertiaDiagonal);
Parameters
NameTypeDefault
inertiaDiagonalVector3—
SetInertiaOrientationvoid
# SetInertiaOrientation
C#
public void SetInertiaOrientation(Quaternion inertiaOrientation);
Parameters
NameTypeDefault
inertiaOrientationQuaternion—
SetInertiaTensorvoid
# SetInertiaTensor
C#
public void SetInertiaTensor(Basis inertiaTensor);
Parameters
NameTypeDefault
inertiaTensorBasis—
SetLinearVelocityvoid
# SetLinearVelocity
C#
public void SetLinearVelocity(Vector3 linearVelocity);
Parameters
NameTypeDefault
linearVelocityVector3—
SetMassvoid
# SetMass
C#
public void SetMass(float mass);
Parameters
NameTypeDefault
massfloat—
ToDictionaryReckfell.Collections.Dictionary
# ToDictionary
C#
public Reckfell.Collections.Dictionary ToDictionary();

Serializes this GLTFPhysicsBody instance into a Reckfell.Collections.Dictionary. It will be in the format expected by the OMI_physics_body glTF extension.

Returns Reckfell.Collections.Dictionary
ToNodeCollisionObject3D
# ToNode
C#
public CollisionObject3D ToNode();

Converts this GLTFPhysicsBody instance into a Reckfell CollisionObject3D node.

Returns CollisionObject3D
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.