@ue-too/dynamics / index / VisualPolygonBody
クラス: VisualPolygonBody
定義: rigidbody.ts:540
Rigid body interface for 2D physics simulation.
Remarks
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 VisualPolygonBody(
center,vertices,drawingContext,_orientationAngle,mass,isStatic,frictionEnabled):VisualPolygonBody
定義: rigidbody.ts:553
パラメータ
center
Point = ...
vertices
Point[]
drawingContext
CanvasRenderingContext2D
_orientationAngle
number = 0
mass
number = 50
isStatic
boolean = false
frictionEnabled
boolean = true
戻り値
VisualPolygonBody
プロパティ
collisionFilter
collisionFilter:
CollisionFilter
定義: rigidbody.ts:545
Collision filtering configuration
の実装
isSleeping
isSleeping:
boolean=false
定義: rigidbody.ts:548
の実装
sleepThreshold
sleepThreshold:
number=0.01
定義: rigidbody.ts:549
の実装
sleepTime
sleepTime:
number=0.5
定義: rigidbody.ts:550
の実装
timeAtRest
timeAtRest:
number=0
定義: rigidbody.ts:551
の実装
アクセッサー
AABB
署名を取得する
get AABB():
object
定義: rigidbody.ts:660
Axis-Aligned Bounding Box for broad phase collision
戻り値
object
max
max:
Point
min
min:
Point
Axis-Aligned Bounding Box for broad phase collision
の実装
angularVelocity
署名を取得する
get angularVelocity():
number
定義: rigidbody.ts:640
Angular velocity (radians/second)
戻り値
number
署名を設定する
set angularVelocity(
angularVelocity):void
定義: rigidbody.ts:644
Angular velocity (radians/second)
パラメータ
angularVelocity
number
戻り値
void
Angular velocity (radians/second)
の実装
center
署名を取得する
get center():
Point
定義: rigidbody.ts:624
Center position in world coordinates
戻り値
Point
署名を設定する
set center(
dest):void
定義: rigidbody.ts:628
Center position in world coordinates
パラメータ
dest
Point
戻り値
void
Center position in world coordinates
の実装
linearVelocity
署名を取得する
get linearVelocity():
Point
定義: rigidbody.ts:632
Linear velocity (pixels/second)
戻り値
Point
署名を設定する
set linearVelocity(
dest):void
定義: rigidbody.ts:636
Linear velocity (pixels/second)
パラメータ
dest
Point
戻り値
void
Linear velocity (pixels/second)
の実装
mass
署名を取得する
get mass():
number
定義: rigidbody.ts:664
Mass in arbitrary units (affects force response)
戻り値
number
Mass in arbitrary units (affects force response)
の実装
momentOfInertia
署名を取得する
get momentOfInertia():
number
定義: rigidbody.ts:676
Moment of inertia (rotational mass)
戻り値
number
Moment of inertia (rotational mass)
の実装
orientationAngle
署名を取得する
get orientationAngle():
number
定義: rigidbody.ts:648
Rotation angle in radians
戻り値
number
Rotation angle in radians
の実装
staticFrictionCoeff
署名を取得する
get staticFrictionCoeff():
number
定義: rigidbody.ts:668
Static friction coefficient (0-1)
戻り値
number
署名を設定する
set staticFrictionCoeff(
coeff):void
定義: rigidbody.ts:672
Static friction coefficient (0-1)
パラメータ
coeff
number
戻り値
void
Static friction coefficient (0-1)
の実装
メソッド
applyForce()
applyForce(
force):void
定義: rigidbody.ts:608
パラメータ
force
Point
戻り値
void
の実装
applyForceInOrientation()
applyForceInOrientation(
force):void
定義: rigidbody.ts:612
パラメータ
force
Point
戻り値
void
の実装
RigidBody.applyForceInOrientation
draw()
draw(
ctx):void
定義: rigidbody.ts:573
パラメータ
ctx
CanvasRenderingContext2D
戻り値
void
の実装
getAdjacentFaces()
getAdjacentFaces(
collisionNormal):object[]
定義: rigidbody.ts:684
パラメータ
collisionNormal
Point
戻り値
object[]
の実装
getCollisionAxes()
getCollisionAxes(
relativeBody):Point[]
定義: rigidbody.ts:604
パラメータ
relativeBody
戻り値
Point[]
の実装
getMinMaxProjection()
getMinMaxProjection(
unitvector):object
定義: rigidbody.ts:600
パラメータ
unitvector
Point
戻り値
object
max
max:
number
min
min:
number
の実装
getNormalOfSignificantFace()
getNormalOfSignificantFace(
collisionNormal):Point
定義: rigidbody.ts:680
パラメータ
collisionNormal
Point
戻り値
Point
の実装
RigidBody.getNormalOfSignificantFace
getSignificantVertices()
getSignificantVertices(
collisionNormal):Point[]
定義: rigidbody.ts:656
パラメータ
collisionNormal
Point
戻り値
Point[]
の実装
RigidBody.getSignificantVertices
isMovingStatic()
isMovingStatic():
boolean
定義: rigidbody.ts:596
戻り値
boolean
の実装
isStatic()
isStatic():
boolean
定義: rigidbody.ts:592
戻り値
boolean
の実装
move()
move(
delta):void
定義: rigidbody.ts:620
パラメータ
delta
Point
戻り値
void
の実装
setLinearVelocity()
setLinearVelocity(
linearVelocity):void
定義: rigidbody.ts:616
パラメータ
linearVelocity
Point
戻り値
void
setSleeping()
setSleeping(
sleeping):void
定義: rigidbody.ts:692
パラメータ
sleeping
boolean
戻り値
void
の実装
significantVertex()
significantVertex(
collisionNormal):Point
定義: rigidbody.ts:652
パラメータ
collisionNormal
Point
戻り値
Point
の実装
step()
step(
deltaTime):void
定義: rigidbody.ts:587
パラメータ
deltaTime
number
戻り値
void
の実装
updateSleeping()
updateSleeping(
deltaTime):void
定義: rigidbody.ts:703
パラメータ
deltaTime
number
戻り値
void