Class: ColliderShape
Shape of collider body, Base class of collider shape
Hierarchy
ColliderShape
Constructors
Accessors
Methods
Constructors
constructor
• new ColliderShape(): ColliderShape
Returns
Defined in
src/components/shape/ColliderShape.ts:30
Accessors
shapeType
• get shapeType(): ColliderShapeType
Returns
Defined in
src/components/shape/ColliderShape.ts:40
center
• get center(): Vector3
The position of the collision object in the local space of the object.
Returns
Defined in
src/components/shape/ColliderShape.ts:59
• set center(value): void
Parameters
| Name | Type |
|---|---|
value | Vector3 |
Returns
void
Defined in
src/components/shape/ColliderShape.ts:63
size
• get size(): Vector3
The size of the collision body in the X, Y, and Z directions.
Returns
Vector3
Defined in
src/components/shape/ColliderShape.ts:72
• set size(value): void
Parameters
| Name | Type |
|---|---|
value | Vector3 |
Returns
void
Defined in
src/components/shape/ColliderShape.ts:76
halfSize
• get halfSize(): Vector3
Half the size of the collision body.
Returns
Defined in
src/components/shape/ColliderShape.ts:84
Methods
setFromCenterAndSize
▸ setFromCenterAndSize(ct?, sz?): this
Set the position and size of collision objects
Parameters
| Name | Type | Description |
|---|---|---|
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
Defined in
src/components/shape/ColliderShape.ts:50
rayPick
▸ rayPick(ray, fromMatrix): HitInfo
Ray pickup.Emit a ray from a designated location to detect objects colliding with the ray.
Parameters
| Name | Type | Description |
|---|---|---|
ray | Ray | emit ray |
fromMatrix | Matrix4 | matrix |
Returns
Pick result intersect: whether to collide; IntersectPoint: collision point; Distance: The distance from the origin of the ray to the collision point.

