@ue-too/dynamics / index / VisualPolygonBody
クラス: VisualPolygonBody
定義: rigidbody.ts:546
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:559
パラメータ
center
Point = ...
vertices
Point[]
drawingContext
CanvasRenderingContext2D
_orientationAngle
number = 0
mass
number = 50
isStatic
boolean = false
frictionEnabled
boolean = true
戻り値
VisualPolygonBody
プロパティ
collisionFilter
collisionFilter:
CollisionFilter
定義: rigidbody.ts:551
Collision filtering configuration
の実装
isSleeping
isSleeping:
boolean=false
定義: rigidbody.ts:554
の実装
sleepThreshold
sleepThreshold:
number=0.01
定義: rigidbody.ts:555
の実装
sleepTime
sleepTime:
number=0.5
定義: rigidbody.ts:556
の実装
timeAtRest
timeAtRest:
number=0
定義: rigidbody.ts:557
の実装
アクセッサー
AABB
署名を取得する
get AABB():
object
定義: rigidbody.ts:666
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:646
Angular velocity (radians/second)
戻り値
number
署名を設定する
set angularVelocity(
angularVelocity):void
定義: rigidbody.ts:650
Angular velocity (radians/second)
パラメータ
angularVelocity
number
戻り値
void
Angular velocity (radians/second)
の実装
center
署名を取得する
get center():
Point
定義: rigidbody.ts:630
Center position in world coordinates
戻り値
Point
署名を設定する
set center(
dest):void
定義: rigidbody.ts:634
Center position in world coordinates
パラメータ
dest
Point
戻り値
void
Center position in world coordinates
の実装
linearVelocity
署名を取得する
get linearVelocity():
Point
定義: rigidbody.ts:638
Linear velocity (pixels/second)
戻り値
Point
署名を設定する
set linearVelocity(
dest):void
定義: rigidbody.ts:642
Linear velocity (pixels/second)
パラメータ
dest
Point
戻り値
void
Linear velocity (pixels/second)
の実装
mass
署名を取得する
get mass():
number
定義: rigidbody.ts:670
Mass in arbitrary units (affects force response)
戻り値
number
Mass in arbitrary units (affects force response)
の実装
momentOfInertia
署名を取得する
get momentOfInertia():
number
定義: rigidbody.ts:682
Moment of inertia (rotational mass)
戻り値
number
Moment of inertia (rotational mass)
の実装
orientationAngle
署名を取得する
get orientationAngle():
number
定義: rigidbody.ts:654
Rotation angle in radians
戻り値
number
Rotation angle in radians
の実装
staticFrictionCoeff
署名を取得する
get staticFrictionCoeff():
number
定義: rigidbody.ts:674
Static friction coefficient (0-1)
戻り値
number
署名を設定する
set staticFrictionCoeff(
coeff):void
定義: rigidbody.ts:678
Static friction coefficient (0-1)
パラメータ
coeff
number
戻り値
void
Static friction coefficient (0-1)
の実装
メソッド
applyForce()
applyForce(
force):void
定義: rigidbody.ts:614
パラメータ
force
Point
戻り値
void
の実装
applyForceInOrientation()
applyForceInOrientation(
force):void
定義: rigidbody.ts:618
パラメータ
force
Point
戻り値
void
の実装
RigidBody.applyForceInOrientation
draw()
draw(
ctx):void
定義: rigidbody.ts:579
パラメータ
ctx
CanvasRenderingContext2D
戻り値
void
の実装
getAdjacentFaces()
getAdjacentFaces(
collisionNormal):object[]
定義: rigidbody.ts:690
パラメータ
collisionNormal
Point
戻り値
object[]
の実装
getCollisionAxes()
getCollisionAxes(
relativeBody):Point[]
定義: rigidbody.ts:610
パラメータ
relativeBody
戻り値
Point[]
の実装
getMinMaxProjection()
getMinMaxProjection(
unitvector):object
定義: rigidbody.ts:606
パラメータ
unitvector
Point
戻り値
object
max
max:
number
min
min:
number
の実装
getNormalOfSignificantFace()
getNormalOfSignificantFace(
collisionNormal):Point
定義: rigidbody.ts:686
パラメータ
collisionNormal
Point
戻り値
Point
の実装
RigidBody.getNormalOfSignificantFace
getSignificantVertices()
getSignificantVertices(
collisionNormal):Point[]
定義: rigidbody.ts:662
パラメータ
collisionNormal
Point
戻り値
Point[]
の実装
RigidBody.getSignificantVertices
isMovingStatic()
isMovingStatic():
boolean
定義: rigidbody.ts:602
戻り値
boolean
の実装
isStatic()
isStatic():
boolean
定義: rigidbody.ts:598
戻り値
boolean
の実装
move()
move(
delta):void
定義: rigidbody.ts:626
パラメータ
delta
Point
戻り値
void
の実装
setLinearVelocity()
setLinearVelocity(
linearVelocity):void
定義: rigidbody.ts:622
パラメータ
linearVelocity
Point
戻り値
void
setSleeping()
setSleeping(
sleeping):void
定義: rigidbody.ts:698
パラメータ
sleeping
boolean
戻り値
void
の実装
significantVertex()
significantVertex(
collisionNormal):Point
定義: rigidbody.ts:658
パラメータ
collisionNormal
Point
戻り値
Point
の実装
step()
step(
deltaTime):void
定義: rigidbody.ts:593
パラメータ
deltaTime
number
戻り値
void
の実装
updateSleeping()
updateSleeping(
deltaTime):void
定義: rigidbody.ts:709
パラメータ
deltaTime
number
戻り値
void