PhysicsDirectBodyState2DExtension
继承: PhysicsDirectBodyState2D
< Object
Provides virtual methods that can be overridden to create custom PhysicsDirectBodyState2D
implementations.
描述
This class extends PhysicsDirectBodyState2D
by providing additional virtual methods that can be overridden. When these methods are overridden, they will be called instead of the internal methods of the physics server.
Intended for use with GDExtension to create custom implementations of PhysicsDirectBodyState2D
.
方法
方法说明
void
_add_constant_central_force ( force: Vector2
) virtual1
Overridable version of PhysicsDirectBodyState2D.add_constant_central_force
.
void
_add_constant_force ( force: Vector2
, position: Vector2
) virtual1
Overridable version of PhysicsDirectBodyState2D.add_constant_force
.
void
_add_constant_torque ( torque: float
) virtual1
Overridable version of PhysicsDirectBodyState2D.add_constant_torque
.
void
_apply_central_force ( force: Vector2
) virtual1
Overridable version of PhysicsDirectBodyState2D.apply_central_force
.
void
_apply_central_impulse ( impulse: Vector2
) virtual1
Overridable version of PhysicsDirectBodyState2D.apply_central_impulse
.
void
_apply_force ( force: Vector2
, position: Vector2
) virtual1
Overridable version of PhysicsDirectBodyState2D.apply_force
.
void
_apply_impulse ( impulse: Vector2
, position: Vector2
) virtual1
Overridable version of PhysicsDirectBodyState2D.apply_impulse
.
void
_apply_torque ( torque: float
) virtual1
Overridable version of PhysicsDirectBodyState2D.apply_torque
.
void
_apply_torque_impulse ( impulse: float
) virtual1
Overridable version of PhysicsDirectBodyState2D.apply_torque_impulse
.
float
_get_angular_velocity ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.angular_velocity
and its respective getter.
Vector2
_get_center_of_mass ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.center_of_mass
and its respective getter.
Vector2
_get_center_of_mass_local ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.center_of_mass_local
and its respective getter.
Vector2
_get_constant_force ( ) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_constant_force
.
float
_get_constant_torque ( ) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_constant_torque
.
RID
_get_contact_collider ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_collider
.
int
_get_contact_collider_id ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_collider_id
.
Object
_get_contact_collider_object ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_collider_object
.
Vector2
_get_contact_collider_position ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_collider_position
.
int
_get_contact_collider_shape ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_collider_shape
.
Vector2
_get_contact_collider_velocity_at_position ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_collider_velocity_at_position
.
int
_get_contact_count ( ) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_count
.
Vector2
_get_contact_impulse ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_impulse
.
Vector2
_get_contact_local_normal ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_local_normal
.
Vector2
_get_contact_local_position ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_local_position
.
int
_get_contact_local_shape ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_local_shape
.
Vector2
_get_contact_local_velocity_at_position ( contact_idx: int
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_contact_local_velocity_at_position
.
float
_get_inverse_inertia ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.inverse_inertia
and its respective getter.
float
_get_inverse_mass ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.inverse_mass
and its respective getter.
Vector2
_get_linear_velocity ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.linear_velocity
and its respective getter.
PhysicsDirectSpaceState2D
_get_space_state ( ) virtual1
Overridable version of PhysicsDirectBodyState2D.get_space_state
.
float
_get_step ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.step
and its respective getter.
float
_get_total_angular_damp ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.total_angular_damp
and its respective getter.
Vector2
_get_total_gravity ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.total_gravity
and its respective getter.
float
_get_total_linear_damp ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.total_linear_damp
and its respective getter.
Transform2D
_get_transform ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.transform
and its respective getter.
Vector2
_get_velocity_at_local_position ( local_position: Vector2
) virtual1 const2
Overridable version of PhysicsDirectBodyState2D.get_velocity_at_local_position
.
void
_integrate_forces ( ) virtual1
Overridable version of PhysicsDirectBodyState2D.integrate_forces
.
bool
_is_sleeping ( ) virtual1 const2
Implement to override the behavior of PhysicsDirectBodyState2D.sleeping
and its respective getter.
void
_set_angular_velocity ( velocity: float
) virtual1
Implement to override the behavior of PhysicsDirectBodyState2D.angular_velocity
and its respective setter.
void
_set_constant_force ( force: Vector2
) virtual1
Overridable version of PhysicsDirectBodyState2D.set_constant_force
.
void
_set_constant_torque ( torque: float
) virtual1
Overridable version of PhysicsDirectBodyState2D.set_constant_torque
.
void
_set_linear_velocity ( velocity: Vector2
) virtual1
Implement to override the behavior of PhysicsDirectBodyState2D.linear_velocity
and its respective setter.
void
_set_sleep_state ( enabled: bool
) virtual1
Implement to override the behavior of PhysicsDirectBodyState2D.sleeping
and its respective setter.
void
_set_transform ( transform: Transform2D
) virtual1
Implement to override the behavior of PhysicsDirectBodyState2D.transform
and its respective setter.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。