Skip to content

@orillusion/core


Class: SphereColliderShape ​

Defined in: src/components/shape/SphereColliderShape.ts:12

Spherical collision body

Extends ​

Constructors ​

Constructor ​

new SphereColliderShape(radius): SphereColliderShape

Defined in: src/components/shape/SphereColliderShape.ts:25

Parameters ​

radius ​

number

radius of this collider

Returns ​

SphereColliderShape

Overrides ​

ColliderShape.constructor

Properties ​

radius ​

radius: number = 0.5

Defined in: src/components/shape/SphereColliderShape.ts:19

radius of this collider

Accessors ​

shapeType ​

Get Signature ​

get shapeType(): ColliderShapeType

Defined in: src/components/shape/ColliderShape.ts:73

Returns ​

ColliderShapeType

Inherited from ​

ColliderShape.shapeType


center ​

Get Signature ​

get center(): Vector3

Defined in: src/components/shape/ColliderShape.ts:92

The position of the collision object in the local space of the object.

Returns ​

Vector3

Set Signature ​

set center(value): void

Defined in: src/components/shape/ColliderShape.ts:96

Parameters ​
value ​

Vector3

Returns ​

void

Inherited from ​

ColliderShape.center


size ​

Get Signature ​

get size(): Vector3

Defined in: src/components/shape/ColliderShape.ts:105

The size of the collision body in the X, Y, and Z directions.

Returns ​

Vector3

Vector3

Set Signature ​

set size(value): void

Defined in: src/components/shape/ColliderShape.ts:109

Parameters ​
value ​

Vector3

Returns ​

void

Inherited from ​

ColliderShape.size


halfSize ​

Get Signature ​

get halfSize(): Vector3

Defined in: src/components/shape/ColliderShape.ts:117

Half the size of the collision body.

Returns ​

Vector3

Inherited from ​

ColliderShape.halfSize

Methods ​

setFromCenterAndSize() ​

setFromCenterAndSize(ct?, sz?): this

Defined in: src/components/shape/ColliderShape.ts:83

Set the position and size of collision objects

Parameters ​

ct? ​

Vector3

The position of the collision object in the local space of the object.

sz? ​

Vector3

The size of the collision body in the X, Y, and Z directions.

Returns ​

this

Inherited from ​

ColliderShape.setFromCenterAndSize


transformNormal() ​

static transformNormal(invMatrix, n, out): Vector3

Defined in: src/components/shape/ColliderShape.ts:158

Transform a local-space normal to world space with the inverse transpose of the local → world matrix. See MeshRaycast.transformNormal.

Parameters ​

invMatrix ​

Matrix4

n ​

Vector3

out ​

Vector3

Returns ​

Vector3

Inherited from ​

ColliderShape.transformNormal


rayPick() ​

rayPick(ray, fromMatrix): HitInfo

Defined in: src/components/shape/SphereColliderShape.ts:39

Entry point of ray on the sphere (exit point when the ray starts inside). Point, normal and distance are world space; the local hit point is in localPoint.

Parameters ​

ray ​

Ray

world-space ray

fromMatrix ​

Matrix4

local → world matrix

Returns ​

HitInfo

Overrides ​

ColliderShape.rayPick