Function ambient_api::prelude::physics::add_impulse_at_position
source · pub fn add_impulse_at_position(entity: EntityId, impulse: Vec3, position: Vec3)
Expand description
Applies an impulse
(a Vec3) at given position
(a Vec3) to the entity
(an EntityId) specified.
impulse
is a vector in world space, which means it has both direction and magnitude. To push objects upwards
(positive Z) with strength 3,000, you would supply an impulse of vec3(0.0, 0.0, 3_000.0)
or
Vec3::Z * 3_000.0
(either are equivalent.)
position
is a position in world space, it typically should fall on the surface or interior of an object for
realistic results.