class Rosegold::Physics
- Rosegold::Physics
- Reference
- Object
Overview
Updates the player feet/look/velocity/on_ground by sending movement packets.
Defined in:
rosegold/control/physics.crConstant Summary
-
DRAG =
0.98
-
GRAVITY =
0.08
-
JUMP_FORCE =
0.42
-
SNEAK_SPEED =
1.31 / 20
-
SPRINT_SPEED =
5.612 / 20
-
VERY_CLOSE =
0.00001
-
WALK_SPEED =
4.3 / 20
Constructors
Class Method Summary
-
.get_grown_obstacles(start : Vec3d, movement : Vec3d, entity_aabb : AABBf, dimension : Dimension) : Array(AABBd)
Returns all block collision boxes that may intersect
entity_aabb
during the movement fromstart
byvec
, including boxes 0.5m higher for stepping. -
.predict_movement_collision(start : Vec3d, velocity : Vec3d, entity_aabb : AABBf, dimension : Dimension)
Applies collision handling including stepping.
-
.predict_movement_collision(start : Vec3d, velocity : Vec3d, obstacles : Array(AABBd))
Applies collision handling including stepping.
Instance Method Summary
- #handle_disconnect
- #handle_reset
- #jump_queued=(jump_queued : Bool)
- #jump_queued? : Bool
-
#look=(target : Look)
Set the look target and wait until it is achieved.
- #look_target
-
#move(target : Vec3d | Nil)
Set the movement target location and wait until it is achieved.
- #movement_speed : Float64
- #movement_target
- #pause
- #paused=(paused : Bool)
- #paused? : Bool
- #sneak(sneaking = true)
- #sprint(sprinting = true)
- #tick
- #very_close_to?(target : Vec3d)
Constructor Detail
Class Method Detail
Returns all block collision boxes that may intersect entity_aabb
during the movement from start
by vec
,
including boxes 0.5m higher for stepping.
entity_aabb
is at 0,0,0; the returned AABBs are grown by entity_aabb
so collision checks are just raytracing.
Applies collision handling including stepping. Returns adjusted movement vector and adjusted post-movement velocity.
Applies collision handling including stepping. Returns adjusted movement vector and adjusted post-movement velocity.
Instance Method Detail
Set the look target and wait until it is achieved. If there is already a look target, it is cancelled, and replaced with this new target.
Set the movement target location and wait until it is achieved.
If there is already a movement target, it is cancelled, and replaced with this new target.
Set target=nil
to stop moving and cancel any current movement.