Options
All
  • Public
  • Public/Protected
  • All
Menu

Class b2Body

Hierarchy

  • b2Body

Index

Constructors

Properties

Methods

Constructors

constructor

  • Parameters

    Returns b2Body

Properties

m_I

m_I: number = 0

m_activeFlag

m_activeFlag: boolean = false

m_angularDamping

m_angularDamping: number = 0

m_angularVelocity

m_angularVelocity: number = 0

m_autoSleepFlag

m_autoSleepFlag: boolean = false

m_awakeFlag

m_awakeFlag: boolean = false

m_bulletFlag

m_bulletFlag: boolean = false

m_contactList

m_contactList: b2ContactEdge | null = null

m_controllerCount

m_controllerCount: number = 0

m_controllerList

m_controllerList: b2ControllerEdge | null = null

m_fixedRotationFlag

m_fixedRotationFlag: boolean = false

m_fixtureCount

m_fixtureCount: number = 0

m_fixtureList

m_fixtureList: b2Fixture | null = null

Readonly m_force

m_force: b2Vec2 = new b2Vec2()

m_gravityScale

m_gravityScale: number = 1

m_invI

m_invI: number = 0

m_invMass

m_invMass: number = 1

m_islandFlag

m_islandFlag: boolean = false

m_islandIndex

m_islandIndex: number = 0

m_jointList

m_jointList: b2JointEdge | null = null

m_linearDamping

m_linearDamping: number = 0

Readonly m_linearVelocity

m_linearVelocity: b2Vec2 = new b2Vec2()

m_mass

m_mass: number = 1

m_next

m_next: b2Body | null = null

m_prev

m_prev: b2Body | null = null

m_sleepTime

m_sleepTime: number = 0

Readonly m_sweep

m_sweep: b2Sweep = new b2Sweep()

m_toiFlag

m_toiFlag: boolean = false

m_torque

m_torque: number = 0

m_type

m_type: b2BodyType = b2BodyType.b2_staticBody

m_userData

m_userData: any = null

m_world

m_world: b2World

Readonly m_xf

m_xf: b2Transform = new b2Transform()

Readonly m_xf0

m_xf0: b2Transform = new b2Transform()

Static Private CreateFixtureShapeDensity_s_def

CreateFixtureShapeDensity_s_def: b2FixtureDef = new b2FixtureDef()

Static Private ResetMassData_s_localCenter

ResetMassData_s_localCenter: b2Vec2 = new b2Vec2()

Static Private ResetMassData_s_massData

ResetMassData_s_massData: b2MassData = new b2MassData()

Static Private ResetMassData_s_oldCenter

ResetMassData_s_oldCenter: b2Vec2 = new b2Vec2()

Static Private SetMassData_s_oldCenter

SetMassData_s_oldCenter: b2Vec2 = new b2Vec2()

Static Private SynchronizeFixtures_s_displacement

SynchronizeFixtures_s_displacement: b2Vec2 = new b2Vec2()

Static Private SynchronizeFixtures_s_xf1

SynchronizeFixtures_s_xf1: b2Transform = new b2Transform()

Methods

Advance

  • Advance(alpha: number): void
  • Parameters

    • alpha: number

    Returns void

ApplyAngularImpulse

  • ApplyAngularImpulse(impulse: number, wake?: boolean): void
  • Parameters

    • impulse: number
    • Default value wake: boolean = true

    Returns void

ApplyForce

  • ApplyForce(force: XY, point: XY, wake?: boolean): void
  • Parameters

    • force: XY
    • point: XY
    • Default value wake: boolean = true

    Returns void

ApplyForceToCenter

  • ApplyForceToCenter(force: XY, wake?: boolean): void
  • Parameters

    • force: XY
    • Default value wake: boolean = true

    Returns void

ApplyLinearImpulse

  • ApplyLinearImpulse(impulse: XY, point: XY, wake?: boolean): void
  • Parameters

    • impulse: XY
    • point: XY
    • Default value wake: boolean = true

    Returns void

ApplyLinearImpulseToCenter

  • ApplyLinearImpulseToCenter(impulse: XY, wake?: boolean): void
  • Parameters

    • impulse: XY
    • Default value wake: boolean = true

    Returns void

ApplyTorque

  • ApplyTorque(torque: number, wake?: boolean): void
  • Parameters

    • torque: number
    • Default value wake: boolean = true

    Returns void

CreateFixture

  • Parameters

    Returns b2Fixture

  • Parameters

    Returns b2Fixture

  • Parameters

    Returns b2Fixture

CreateFixtureDef

  • Parameters

    Returns b2Fixture

CreateFixtureShapeDensity

  • Parameters

    • shape: b2Shape
    • Default value density: number = 0

    Returns b2Fixture

DestroyFixture

  • Parameters

    Returns void

Dump

  • Dump(log: (format: string, ...args: any[]) => void): void
  • Parameters

    • log: (format: string, ...args: any[]) => void
        • (format: string, ...args: any[]): void
        • Parameters

          • format: string
          • Rest ...args: any[]

          Returns void

    Returns void

GetAngle

  • GetAngle(): number
  • Returns number

GetAngularDamping

  • GetAngularDamping(): number
  • Returns number

GetAngularVelocity

  • GetAngularVelocity(): number
  • Returns number

GetContactList

  • Returns b2ContactEdge | null

GetControllerCount

  • GetControllerCount(): number
  • Returns number

GetControllerList

  • Returns b2ControllerEdge | null

GetDefinition

  • Parameters

    Returns b2BodyDef

GetFixtureList

  • Returns b2Fixture | null

GetGravityScale

  • GetGravityScale(): number
  • Returns number

GetInertia

  • GetInertia(): number
  • Returns number

GetJointList

  • Returns b2JointEdge | null

GetLinearDamping

  • GetLinearDamping(): number
  • Returns number

GetLinearVelocity

  • GetLinearVelocity(): Readonly<b2Vec2>
  • Returns Readonly<b2Vec2>

GetLinearVelocityFromLocalPoint

  • GetLinearVelocityFromLocalPoint<T>(localPoint: XY, out: T): T
  • Type parameters

    Parameters

    • localPoint: XY
    • out: T

    Returns T

GetLinearVelocityFromWorldPoint

  • GetLinearVelocityFromWorldPoint<T>(worldPoint: XY, out: T): T
  • Type parameters

    Parameters

    • worldPoint: XY
    • out: T

    Returns T

GetLocalCenter

  • GetLocalCenter(): Readonly<b2Vec2>
  • Returns Readonly<b2Vec2>

GetLocalPoint

  • GetLocalPoint<T>(worldPoint: XY, out: T): T
  • Type parameters

    Parameters

    • worldPoint: XY
    • out: T

    Returns T

GetLocalVector

  • GetLocalVector<T>(worldVector: XY, out: T): T
  • Type parameters

    Parameters

    • worldVector: XY
    • out: T

    Returns T

GetMass

  • GetMass(): number
  • Returns number

GetMassData

  • Parameters

    Returns b2MassData

GetNext

  • Returns b2Body | null

GetPosition

  • GetPosition(): Readonly<b2Vec2>
  • Returns Readonly<b2Vec2>

GetTransform

  • Returns Readonly<b2Transform>

GetType

  • Returns b2BodyType

GetUserData

  • GetUserData(): any
  • Returns any

GetWorld

  • Returns b2World

GetWorldCenter

  • GetWorldCenter(): Readonly<b2Vec2>
  • Returns Readonly<b2Vec2>

GetWorldPoint

  • GetWorldPoint<T>(localPoint: XY, out: T): T
  • Type parameters

    Parameters

    • localPoint: XY
    • out: T

    Returns T

GetWorldVector

  • GetWorldVector<T>(localVector: XY, out: T): T
  • Type parameters

    Parameters

    • localVector: XY
    • out: T

    Returns T

IsActive

  • IsActive(): boolean
  • Returns boolean

IsAwake

  • IsAwake(): boolean
  • Returns boolean

IsBullet

  • IsBullet(): boolean
  • Returns boolean

IsFixedRotation

  • IsFixedRotation(): boolean
  • Returns boolean

IsSleepingAllowed

  • IsSleepingAllowed(): boolean
  • Returns boolean

ResetMassData

  • ResetMassData(): void
  • Returns void

SetActive

  • SetActive(flag: boolean): void
  • Parameters

    • flag: boolean

    Returns void

SetAngle

  • SetAngle(angle: number): void
  • Parameters

    • angle: number

    Returns void

SetAngularDamping

  • SetAngularDamping(angularDamping: number): void
  • Parameters

    • angularDamping: number

    Returns void

SetAngularVelocity

  • SetAngularVelocity(w: number): void
  • Parameters

    • w: number

    Returns void

SetAwake

  • SetAwake(flag: boolean): void
  • Parameters

    • flag: boolean

    Returns void

SetBullet

  • SetBullet(flag: boolean): void
  • Parameters

    • flag: boolean

    Returns void

SetFixedRotation

  • SetFixedRotation(flag: boolean): void
  • Parameters

    • flag: boolean

    Returns void

SetGravityScale

  • SetGravityScale(scale: number): void
  • Parameters

    • scale: number

    Returns void

SetLinearDamping

  • SetLinearDamping(linearDamping: number): void
  • Parameters

    • linearDamping: number

    Returns void

SetLinearVelocity

  • SetLinearVelocity(v: XY): void
  • Parameters

    Returns void

SetMassData

  • Parameters

    Returns void

SetPosition

  • SetPosition(position: XY): void
  • Parameters

    • position: XY

    Returns void

SetPositionXY

  • SetPositionXY(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

SetSleepingAllowed

  • SetSleepingAllowed(flag: boolean): void
  • Parameters

    • flag: boolean

    Returns void

SetTransform

  • Parameters

    Returns void

SetTransformVec

  • SetTransformVec(position: XY, angle: number): void
  • Parameters

    • position: XY
    • angle: number

    Returns void

SetTransformXY

  • SetTransformXY(x: number, y: number, angle: number): void
  • Parameters

    • x: number
    • y: number
    • angle: number

    Returns void

SetType

  • Parameters

    Returns void

SetUserData

  • SetUserData(data: any): void
  • Parameters

    • data: any

    Returns void

ShouldCollide

  • ShouldCollide(other: b2Body): boolean
  • Parameters

    Returns boolean

ShouldCollideConnected

  • ShouldCollideConnected(other: b2Body): boolean
  • Parameters

    Returns boolean

SynchronizeFixtures

  • SynchronizeFixtures(): void
  • Returns void

SynchronizeTransform

  • SynchronizeTransform(): void
  • Returns void

Generated using TypeDoc