Documentation: VelocityComponent
Jump to navigation
Jump to search
Name | Type | Initial Value | Example Range | Description |
---|---|---|---|---|
Members | ||||
gravity_x | float | 0 | ||
gravity_y | float | 400 | ||
mass | float | 0.05 | [0, 10] | |
air_friction | float | 0.55 | ||
terminal_velocity | float | 1000 | ||
apply_terminal_velocity | bool | true | ||
updates_velocity | bool | true | ||
displace_liquid | bool | true | ||
affect_physics_bodies | bool | false | if true, will move the physics body by the difference of mVelocity to the previous frame | |
limit_to_max_velocity | bool | true | if true will limit the velocity to 61440. You can turn this off, but it's not recommended, since there are some nasty bugs that can happen with extremely high velocities. | |
liquid_death_threshold | int | 0 | if > 0, entity will die if liquid hit count is greater than this. | |
liquid_drag | float | 1 | 1 = slows down in liquid, 0 = doesn't slow down at all | |
Custom data types | ||||
mVelocity | vec2 | (0, 0) | ||
Privates | ||||
mPrevVelocity | vec2 | (0, 0) | used to update physics bodies | |
mLatestLiquidHitCount | int | 0 | ||
mAverageLiquidHitCount | int | 0 | ||
mPrevPosition | ivec2 | (0, 0) |