Class CollisionSpaceComponent

Inheritance Relationships

Base Types

Class Documentation

class CollisionSpaceComponent : public csp::multiplayer::ComponentBase, public csp::multiplayer::IThirdPartyComponentRef, public csp::multiplayer::ITransformComponent

Add box, mesh, capsule and sphere colliders to objects in your Space.

These colliders can act as triggers, which can be used in conjunction with Scripts to drive behavior.

Public Functions

CollisionSpaceComponent(SpaceEntity *Parent)

Constructs the collision space component, and associates it with the specified Parent space entity.

Parameters

Parent – The Space entity that owns this component.

CollisionShape GetCollisionShape() const

Gets the collision shape used by this collision component.

Returns

The colllision shape used by this collision component.

void SetCollisionShape(CollisionShape collisionShape)

Sets the collision shape used by this collision component.

Parameters

collisionShape – The colllision shape used by this collision component.

CollisionMode GetCollisionMode() const

Gets the collision mode used by this collision component.

Returns

The colllision mode used by this collision component.

void SetCollisionMode(CollisionMode collisionMode)

Sets the collision mode used by this collision component.

Parameters

collisionMode – The colllision mode used by this collision component.

const csp::common::String &GetCollisionAssetId() const

Gets the ID of the collision asset used by this collision component.

Returns

The ID of the collision asset used by this collision component.

void SetCollisionAssetId(const csp::common::String &Value)

Sets the ID of the collision asset used by this collision component.

Parameters

Value – The ID of the collision asset used by this collision component.

const csp::common::String &GetAssetCollectionId() const

Gets the ID of the asset collection associated with this component.

Note

To retrieve this component’s collision asset, both the Asset ID and the Asset Collection ID are required.

Returns

The ID of the asset collection associated with this component.

void SetAssetCollectionId(const csp::common::String &Value)

Sets the ID of the asset collection associated with this component.

Note

To retrieve this component’s collision asset, both the Asset ID and the Asset Collection ID are required.

Parameters

Value – The ID of the asset collection associated with this component.

const csp::common::Vector3 GetUnscaledBoundingBoxMin()

Gets the minimum unscaled bounding box of this collision component.

Returns

The minimum unscaled bounding box of this collision component.

const csp::common::Vector3 GetUnscaledBoundingBoxMax()

Gets the maximum unscaled bounding box of this collision component.

Returns

The maximum unscaled bounding box of this collision component.

const csp::common::Vector3 GetScaledBoundingBoxMin()

Gets the minimum scaled bounding box of this collision component.

Returns

The minimum scaled bounding box of this collision component.

const csp::common::Vector3 GetScaledBoundingBoxMax()

Gets the maximum scaled bounding box of this collision component.

Returns

The maximum scaled bounding box of this collision component.

Public Static Functions

static float GetDefaultSphereRadius()

Gets the default radius for a sphere collision mesh.

Returns

The default radius for a sphere collision mesh.

static float GetDefaultCapsuleHalfWidth()

Gets the default half width for a capsule collision mesh.

Returns

The default half width for a capsule collision mesh.

static float GetDefaultCapsuleHalfHeight()

Gets the default half height for a capsule collision mesh.

Returns

The default half height for a capsule collision mesh.