Skip to content

@ue-too/dynamics / index / VisaulCircleBody

類別: VisaulCircleBody ​

定義於: rigidbody.ts:365

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.

實作 ​

建構函式 ​

建構函式 ​

new VisaulCircleBody(center, radius, drawingContext, _orientationAngle, mass, isStatic, frictionEnabled): VisaulCircleBody

定義於: rigidbody.ts:378

參數 ​

center ​

Point = ...

radius ​

number

drawingContext ​

CanvasRenderingContext2D

_orientationAngle ​

number = 0

mass ​

number = 50

isStatic ​

boolean = false

frictionEnabled ​

boolean = true

回傳 ​

VisaulCircleBody

屬性 ​

collisionFilter ​

collisionFilter: CollisionFilter

定義於: rigidbody.ts:370

Collision filtering configuration

實作了 ​

RigidBody.collisionFilter


isSleeping ​

isSleeping: boolean = false

定義於: rigidbody.ts:373

實作了 ​

RigidBody.isSleeping


sleepThreshold ​

sleepThreshold: number = 0.01

定義於: rigidbody.ts:374

實作了 ​

RigidBody.sleepThreshold


sleepTime ​

sleepTime: number = 0.5

定義於: rigidbody.ts:375

實作了 ​

RigidBody.sleepTime


timeAtRest ​

timeAtRest: number = 0

定義於: rigidbody.ts:376

實作了 ​

RigidBody.timeAtRest

存取器 ​

AABB ​

Getter 簽章 ​

get AABB(): object

定義於: rigidbody.ts:435

Axis-Aligned Bounding Box for broad phase collision

回傳 ​

object

max ​

max: Point

min ​

min: Point

Axis-Aligned Bounding Box for broad phase collision

實作了 ​

RigidBody.AABB


angularVelocity ​

Getter 簽章 ​

get angularVelocity(): number

定義於: rigidbody.ts:483

Angular velocity (radians/second)

回傳 ​

number

Setter 簽章 ​

set angularVelocity(angularVelocity): void

定義於: rigidbody.ts:479

Angular velocity (radians/second)

參數 ​
angularVelocity ​

number

回傳 ​

void

Angular velocity (radians/second)

實作了 ​

RigidBody.angularVelocity


center ​

Getter 簽章 ​

get center(): Point

定義於: rigidbody.ts:455

Center position in world coordinates

回傳 ​

Point

Setter 簽章 ​

set center(dest): void

定義於: rigidbody.ts:459

Center position in world coordinates

參數 ​
dest ​

Point

回傳 ​

void

Center position in world coordinates

實作了 ​

RigidBody.center


linearVelocity ​

Getter 簽章 ​

get linearVelocity(): Point

定義於: rigidbody.ts:463

Linear velocity (pixels/second)

回傳 ​

Point

Setter 簽章 ​

set linearVelocity(dest): void

定義於: rigidbody.ts:467

Linear velocity (pixels/second)

參數 ​
dest ​

Point

回傳 ​

void

Linear velocity (pixels/second)

實作了 ​

RigidBody.linearVelocity


mass ​

Getter 簽章 ​

get mass(): number

定義於: rigidbody.ts:487

Mass in arbitrary units (affects force response)

回傳 ​

number

Mass in arbitrary units (affects force response)

實作了 ​

RigidBody.mass


momentOfInertia ​

Getter 簽章 ​

get momentOfInertia(): number

定義於: rigidbody.ts:510

Moment of inertia (rotational mass)

回傳 ​

number

Moment of inertia (rotational mass)

實作了 ​

RigidBody.momentOfInertia


orientationAngle ​

Getter 簽章 ​

get orientationAngle(): number

定義於: rigidbody.ts:471

Rotation angle in radians

回傳 ​

number

Rotation angle in radians

實作了 ​

RigidBody.orientationAngle


staticFrictionCoeff ​

Getter 簽章 ​

get staticFrictionCoeff(): number

定義於: rigidbody.ts:495

Static friction coefficient (0-1)

回傳 ​

number

Setter 簽章 ​

set staticFrictionCoeff(coeff): void

定義於: rigidbody.ts:499

Static friction coefficient (0-1)

參數 ​
coeff ​

number

回傳 ​

void

Static friction coefficient (0-1)

實作了 ​

RigidBody.staticFrictionCoeff

方法 ​

applyForce() ​

applyForce(force): void

定義於: rigidbody.ts:431

參數 ​

force ​

Point

回傳 ​

void

實作了 ​

RigidBody.applyForce


applyForceInOrientation() ​

applyForceInOrientation(force): void

定義於: rigidbody.ts:443

參數 ​

force ​

Point

回傳 ​

void

實作了 ​

RigidBody.applyForceInOrientation


draw() ​

draw(ctx): void

定義於: rigidbody.ts:398

參數 ​

ctx ​

CanvasRenderingContext2D

回傳 ​

void

實作了 ​

VisualComponent.draw


getAdjacentFaces() ​

getAdjacentFaces(collisionNormal): object[]

定義於: rigidbody.ts:503

參數 ​

collisionNormal ​

Point

回傳 ​

object[]

實作了 ​

RigidBody.getAdjacentFaces


getCollisionAxes() ​

getCollisionAxes(relativeBody): Point[]

定義於: rigidbody.ts:427

參數 ​

relativeBody ​

RigidBody

回傳 ​

Point[]

實作了 ​

RigidBody.getCollisionAxes


getMass() ​

getMass(): number

定義於: rigidbody.ts:439

回傳 ​

number


getMinMaxProjection() ​

getMinMaxProjection(unitvector): object

定義於: rigidbody.ts:423

參數 ​

unitvector ​

Point

回傳 ​

object

max ​

max: number

min ​

min: number

實作了 ​

RigidBody.getMinMaxProjection


getNormalOfSignificantFace() ​

getNormalOfSignificantFace(collisionNormal): Point

定義於: rigidbody.ts:491

參數 ​

collisionNormal ​

Point

回傳 ​

Point

實作了 ​

RigidBody.getNormalOfSignificantFace


getSignificantVertices() ​

getSignificantVertices(collisionNormal): Point[]

定義於: rigidbody.ts:451

參數 ​

collisionNormal ​

Point

回傳 ​

Point[]

實作了 ​

RigidBody.getSignificantVertices


isMovingStatic() ​

isMovingStatic(): boolean

定義於: rigidbody.ts:419

回傳 ​

boolean

實作了 ​

RigidBody.isMovingStatic


isStatic() ​

isStatic(): boolean

定義於: rigidbody.ts:415

回傳 ​

boolean

實作了 ​

RigidBody.isStatic


move() ​

move(delta): void

定義於: rigidbody.ts:447

參數 ​

delta ​

Point

回傳 ​

void

實作了 ​

RigidBody.move


setSleeping() ​

setSleeping(sleeping): void

定義於: rigidbody.ts:515

參數 ​

sleeping ​

boolean

回傳 ​

void

實作了 ​

RigidBody.setSleeping


significantVertex() ​

significantVertex(collisionNormal): Point

定義於: rigidbody.ts:475

參數 ​

collisionNormal ​

Point

回傳 ​

Point

實作了 ​

RigidBody.significantVertex


step() ​

step(deltaTime): void

定義於: rigidbody.ts:410

參數 ​

deltaTime ​

number

回傳 ​

void

實作了 ​

RigidBody.step


updateSleeping() ​

updateSleeping(deltaTime): void

定義於: rigidbody.ts:526

參數 ​

deltaTime ​

number

回傳 ​

void

實作了 ​

RigidBody.updateSleeping