@ue-too/dynamics / index / RigidBody
介面: RigidBody
定義於: rigidbody.ts:17
Rigid body interface for 2D physics simulation.
備註
Represents a physical object in the physics world with mass, velocity, rotation, and collision properties. Can be either static (immovable) or dynamic (responds to forces).
Implemented by Circle and Polygon classes.
屬性
AABB
AABB:
object
定義於: rigidbody.ts:27
Axis-Aligned Bounding Box for broad phase collision
max
max:
Point
min
min:
Point
angularVelocity
angularVelocity:
number
定義於: rigidbody.ts:25
Angular velocity (radians/second)
center
center:
Point
定義於: rigidbody.ts:19
Center position in world coordinates
collisionFilter
collisionFilter:
CollisionFilter
定義於: rigidbody.ts:36
Collision filtering configuration
isSleeping
isSleeping:
boolean
定義於: rigidbody.ts:39
linearVelocity
linearVelocity:
Point
定義於: rigidbody.ts:23
Linear velocity (pixels/second)
mass
mass:
number
定義於: rigidbody.ts:29
Mass in arbitrary units (affects force response)
momentOfInertia
momentOfInertia:
number
定義於: rigidbody.ts:33
Moment of inertia (rotational mass)
orientationAngle
orientationAngle:
number
定義於: rigidbody.ts:21
Rotation angle in radians
sleepThreshold
sleepThreshold:
number
定義於: rigidbody.ts:40
sleepTime
sleepTime:
number
定義於: rigidbody.ts:41
staticFrictionCoeff
staticFrictionCoeff:
number
定義於: rigidbody.ts:31
Static friction coefficient (0-1)
timeAtRest
timeAtRest:
number
定義於: rigidbody.ts:42
方法
applyForce()
applyForce(
force):void
定義於: rigidbody.ts:49
參數
force
Point
回傳
void
applyForceInOrientation()
applyForceInOrientation(
force):void
定義於: rigidbody.ts:50
參數
force
Point
回傳
void
getAdjacentFaces()
getAdjacentFaces(
collisionNormal):object[]
定義於: rigidbody.ts:56
參數
collisionNormal
Point
回傳
object[]
getCollisionAxes()
getCollisionAxes(
relativeBody):Point[]
定義於: rigidbody.ts:48
參數
relativeBody
RigidBody
回傳
Point[]
getMinMaxProjection()
getMinMaxProjection(
unitvector):object
定義於: rigidbody.ts:47
參數
unitvector
Point
回傳
object
max
max:
number
min
min:
number
getNormalOfSignificantFace()
getNormalOfSignificantFace(
collisionNormal):Point
定義於: rigidbody.ts:55
參數
collisionNormal
Point
回傳
Point
getSignificantVertices()
getSignificantVertices(
collisionNormal):Point[]
定義於: rigidbody.ts:54
參數
collisionNormal
Point
回傳
Point[]
isMovingStatic()
isMovingStatic():
boolean
定義於: rigidbody.ts:46
回傳
boolean
isStatic()
isStatic():
boolean
定義於: rigidbody.ts:45
回傳
boolean
move()
move(
delta):void
定義於: rigidbody.ts:52
參數
delta
Point
回傳
void
setSleeping()
setSleeping(
sleeping):void
定義於: rigidbody.ts:62
參數
sleeping
boolean
回傳
void
significantVertex()
significantVertex(
collisionNormal):Point
定義於: rigidbody.ts:53
參數
collisionNormal
Point
回傳
Point
step()
step(
deltaTime):void
定義於: rigidbody.ts:44
參數
deltaTime
number
回傳
void
updateSleeping()
updateSleeping(
deltaTime):void
定義於: rigidbody.ts:63
參數
deltaTime
number
回傳
void