Skip to content

@ue-too/dynamics / index / VisaulCircleBody

類別: VisaulCircleBody

定義於: rigidbody.ts:359

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

參數

center

Point = ...

radius

number

drawingContext

CanvasRenderingContext2D

_orientationAngle

number = 0

mass

number = 50

isStatic

boolean = false

frictionEnabled

boolean = true

回傳

VisaulCircleBody

屬性

collisionFilter

collisionFilter: CollisionFilter

定義於: rigidbody.ts:364

Collision filtering configuration

實作了

RigidBody.collisionFilter


isSleeping

isSleeping: boolean = false

定義於: rigidbody.ts:367

實作了

RigidBody.isSleeping


sleepThreshold

sleepThreshold: number = 0.01

定義於: rigidbody.ts:368

實作了

RigidBody.sleepThreshold


sleepTime

sleepTime: number = 0.5

定義於: rigidbody.ts:369

實作了

RigidBody.sleepTime


timeAtRest

timeAtRest: number = 0

定義於: rigidbody.ts:370

實作了

RigidBody.timeAtRest

存取器

AABB

Getter 簽章

get AABB(): object

定義於: rigidbody.ts:429

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

Angular velocity (radians/second)

回傳

number

Setter 簽章

set angularVelocity(angularVelocity): void

定義於: rigidbody.ts:473

Angular velocity (radians/second)

參數
angularVelocity

number

回傳

void

Angular velocity (radians/second)

實作了

RigidBody.angularVelocity


center

Getter 簽章

get center(): Point

定義於: rigidbody.ts:449

Center position in world coordinates

回傳

Point

Setter 簽章

set center(dest): void

定義於: rigidbody.ts:453

Center position in world coordinates

參數
dest

Point

回傳

void

Center position in world coordinates

實作了

RigidBody.center


linearVelocity

Getter 簽章

get linearVelocity(): Point

定義於: rigidbody.ts:457

Linear velocity (pixels/second)

回傳

Point

Setter 簽章

set linearVelocity(dest): void

定義於: rigidbody.ts:461

Linear velocity (pixels/second)

參數
dest

Point

回傳

void

Linear velocity (pixels/second)

實作了

RigidBody.linearVelocity


mass

Getter 簽章

get mass(): number

定義於: rigidbody.ts:481

Mass in arbitrary units (affects force response)

回傳

number

Mass in arbitrary units (affects force response)

實作了

RigidBody.mass


momentOfInertia

Getter 簽章

get momentOfInertia(): number

定義於: rigidbody.ts:504

Moment of inertia (rotational mass)

回傳

number

Moment of inertia (rotational mass)

實作了

RigidBody.momentOfInertia


orientationAngle

Getter 簽章

get orientationAngle(): number

定義於: rigidbody.ts:465

Rotation angle in radians

回傳

number

Rotation angle in radians

實作了

RigidBody.orientationAngle


staticFrictionCoeff

Getter 簽章

get staticFrictionCoeff(): number

定義於: rigidbody.ts:489

Static friction coefficient (0-1)

回傳

number

Setter 簽章

set staticFrictionCoeff(coeff): void

定義於: rigidbody.ts:493

Static friction coefficient (0-1)

參數
coeff

number

回傳

void

Static friction coefficient (0-1)

實作了

RigidBody.staticFrictionCoeff

方法

applyForce()

applyForce(force): void

定義於: rigidbody.ts:425

參數

force

Point

回傳

void

實作了

RigidBody.applyForce


applyForceInOrientation()

applyForceInOrientation(force): void

定義於: rigidbody.ts:437

參數

force

Point

回傳

void

實作了

RigidBody.applyForceInOrientation


draw()

draw(ctx): void

定義於: rigidbody.ts:392

參數

ctx

CanvasRenderingContext2D

回傳

void

實作了

VisualComponent.draw


getAdjacentFaces()

getAdjacentFaces(collisionNormal): object[]

定義於: rigidbody.ts:497

參數

collisionNormal

Point

回傳

object[]

實作了

RigidBody.getAdjacentFaces


getCollisionAxes()

getCollisionAxes(relativeBody): Point[]

定義於: rigidbody.ts:421

參數

relativeBody

RigidBody

回傳

Point[]

實作了

RigidBody.getCollisionAxes


getMass()

getMass(): number

定義於: rigidbody.ts:433

回傳

number


getMinMaxProjection()

getMinMaxProjection(unitvector): object

定義於: rigidbody.ts:417

參數

unitvector

Point

回傳

object

max

max: number

min

min: number

實作了

RigidBody.getMinMaxProjection


getNormalOfSignificantFace()

getNormalOfSignificantFace(collisionNormal): Point

定義於: rigidbody.ts:485

參數

collisionNormal

Point

回傳

Point

實作了

RigidBody.getNormalOfSignificantFace


getSignificantVertices()

getSignificantVertices(collisionNormal): Point[]

定義於: rigidbody.ts:445

參數

collisionNormal

Point

回傳

Point[]

實作了

RigidBody.getSignificantVertices


isMovingStatic()

isMovingStatic(): boolean

定義於: rigidbody.ts:413

回傳

boolean

實作了

RigidBody.isMovingStatic


isStatic()

isStatic(): boolean

定義於: rigidbody.ts:409

回傳

boolean

實作了

RigidBody.isStatic


move()

move(delta): void

定義於: rigidbody.ts:441

參數

delta

Point

回傳

void

實作了

RigidBody.move


setSleeping()

setSleeping(sleeping): void

定義於: rigidbody.ts:509

參數

sleeping

boolean

回傳

void

實作了

RigidBody.setSleeping


significantVertex()

significantVertex(collisionNormal): Point

定義於: rigidbody.ts:469

參數

collisionNormal

Point

回傳

Point

實作了

RigidBody.significantVertex


step()

step(deltaTime): void

定義於: rigidbody.ts:404

參數

deltaTime

number

回傳

void

實作了

RigidBody.step


updateSleeping()

updateSleeping(deltaTime): void

定義於: rigidbody.ts:520

參數

deltaTime

number

回傳

void

實作了

RigidBody.updateSleeping