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:26

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:20

radius of this collider

Accessors

shapeType

Get Signature

get shapeType(): ColliderShapeType

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

Returns

ColliderShapeType

Inherited from

ColliderShape.shapeType


center

Get Signature

get center(): Vector3

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

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:64

Parameters
value

Vector3

Returns

void

Inherited from

ColliderShape.center


size

Get Signature

get size(): Vector3

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

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:77

Parameters
value

Vector3

Returns

void

Inherited from

ColliderShape.size


halfSize

Get Signature

get halfSize(): Vector3

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

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:51

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


rayPick()

rayPick(ray, fromMatrix): object

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

Ray pickup.Emit a ray from a designated location to detect objects colliding with the ray.

Parameters

ray

Ray

emit ray

fromMatrix

Matrix4

matrix

Returns

object

Pick result intersect: whether to collide; IntersectPoint: collision point; Distance: The distance from the origin of the ray to the collision point.

intersect

intersect: boolean

intersectPoint?

optional intersectPoint?: Vector3

distance

distance: number

Overrides

ColliderShape.rayPick