wecs.panda3d.character module

class wecs.panda3d.character.CharacterController(move: panda3d.core.LVector3f = <factory>, heading: float = 0.0, pitch: float = 0.0, jumps: bool = False, sprints: bool = False, crouches: bool = False, max_heading: float = 90.0, max_pitch: float = 90.0, translation: panda3d.core.LVector3f = <factory>, rotation: panda3d.core.LVector3f = <factory>, clamp_pitch: bool = True, last_translation_speed: panda3d.core.LVector3f = <factory>, last_rotation_speed: panda3d.core.LVector3f = <factory>)

Bases: object

A moving entity.

Parameters:
  • move (Vec3) – (0, 0, 0) - speed of relative movement
  • heading (float) – 0.0 - horizontal direction the character is headed
  • pitch (float) – 0.0 - vertical direction the character is headed
  • jumps (bool) – False - Triggers a jump
  • sprints (bool) – False - Is True when sprinting
  • crouches (bool) – False - Is True when crouching

Remaining variables are calculated by systems.

heading = 0.0
pitch = 0.0
jumps = False
sprints = False
crouches = False
max_heading = 90.0
max_pitch = 90.0
clamp_pitch = True
class wecs.panda3d.character.FloatingMovement(speed: float = 200.0, turning_speed: float = 60.0)

Bases: object

This character floats, moves with 6 degrees of freedom.

Parameters:
  • speed (float) – 200.0 - speed of relative forward movement
  • turning_speed (float) – 60.0 - rotation speed
speed = 200.0
turning_speed = 60.0
class wecs.panda3d.character.WalkingMovement(speed: float = 10.0, backwards_multiplier: float = 0.5, turning_speed: float = 60.0)

Bases: object

This character walks, moves on the horizontal dimensions.

Parameters:
  • speed (float) – 10.0 - speed of relative forward movement
  • backwards_multiplier (float) – 0.5 - how much faster is backwards movement
  • turning_speed (float) – 60.0 - rotation speed
speed = 10.0
backwards_multiplier = 0.5
turning_speed = 60.0
class wecs.panda3d.character.SprintingMovement(speed: float = 20.0)

Bases: object

This character can sprint.

Parameters:speed (float) – 20.0 - speed of relative forward movement when sprinting
speed = 20.0
class wecs.panda3d.character.CrouchingMovement(speed: float = 10.0, height: float = 0.4)

Bases: object

This character can crouch.

Parameters:
  • speed (float) – 10.0 - speed of relative forward movement when crouching
  • height (float) – 0.4 - the height of the character when crouched
speed = 10.0
height = 0.4
class wecs.panda3d.character.JumpingMovement(speed: panda3d.core.LVector3f = <factory>, impulse: bool = <factory>)

Bases: object

This character can jump.

Parameters:
  • speed (Vec3) – (1, 1, 0) - speed of relative movement when jumping
  • impulse (float) – (0, 0, 5) - initial speed of jump
class wecs.panda3d.character.InertialMovement(acceleration: float = 30.0, rotated_inertia: float = 0.5, node: panda3d.core.NodePath = <factory>, ignore_z: bool = True)

Bases: object

This character can jump.

Parameters:
  • acceleration (float) – 30.0 - rate at which to accumulate speed
  • rotated_inertia (float) – 0.5 - how much rotation impacts inertia
  • node (NodePath) – NodePath(“Inertia”) - relative position based on inertia
  • ignore_z (bool) – True - ignore_z
acceleration = 30.0
rotated_inertia = 0.5
ignore_z = True
class wecs.panda3d.character.TurningBackToCameraMovement(view_axis_alignment: float = 1, threshold: float = 0.2)

Bases: object

This character has a tendency to face away from the camera.

Parameters:view_axis_alignment (float) – 1 - rate at which to turn away
view_axis_alignment = 1
threshold = 0.2
class wecs.panda3d.character.FacingMovement

Bases: object

class wecs.panda3d.character.BumpingMovement(tag_name: str = 'bumping', solids: dict = <factory>, contacts: list = <factory>, traverser: panda3d.core.CollisionTraverser = <factory>, queue: panda3d.core.CollisionHandlerQueue = <factory>, debug: bool = False)

Bases: object

This character’s horizontal movement is hindered by collisions.

tag_name = 'bumping'
debug = False
class wecs.panda3d.character.FallingMovement(gravity: panda3d.core.LVector3f = <factory>, inertia: panda3d.core.LVector3f = <factory>, local_gravity: panda3d.core.LVector3f = <factory>, ground_contact: bool = False, tag_name: str = 'falling', solids: dict = <factory>, contacts: list = <factory>, traverser: panda3d.core.CollisionTraverser = <factory>, queue: panda3d.core.CollisionHandlerQueue = <factory>, debug: bool = False)

Bases: object

This character falls unless on solid ground.

ground_contact = False
tag_name = 'falling'
debug = False
class wecs.panda3d.character.UpdateCharacter(throw_exc=False)

Bases: wecs.core.System

Convert input to character movement.

Components used wecs.core.and_filter() ‘character’
wecs.panda3d.model.Clock
wecs.panda3d.mode.Model
entity_filters = {'character': <wecs.core.AndFilter object>, 'input': <wecs.core.AndFilter object>}
input_context = 'character_movement'
update(entities_by_filter)
class wecs.panda3d.character.CollisionSystem(throw_exc=False)

Bases: wecs.core.System

init_sensors(entity, movement)
add_shape(entity, movement, solid, shape)
run_sensors(entity, movement)
class wecs.panda3d.character.Floating(throw_exc=False)

Bases: wecs.core.System

Components used wecs.core.and_filter() ‘character’
entity_filters = {'character': <wecs.core.AndFilter object>}
update(entities_by_filter)
class wecs.panda3d.character.Walking(throw_exc=False)

Bases: wecs.core.System

Components used wecs.core.and_filter() ‘character’
entity_filters = {'character': <wecs.core.AndFilter object>}
update(entities_by_filter)
class wecs.panda3d.character.TurningBackToCamera(throw_exc=False)

Bases: wecs.core.System

Turns character away from the camera.

Components used wecs.core.and_filter() ‘character’
wecs.panda3d.camera.ThirdPersonCamera
wecs.panda3d.camera.TurntableCamera
wecs.panda3d.model.Clock
entity_filters = {'character': <wecs.core.AndFilter object>}
update(entities_by_filter)
class wecs.panda3d.character.FaceMovement(throw_exc=False)

Bases: wecs.core.System

entity_filters = {'character': <wecs.core.AndFilter object>}
update(entities_by_filter)
class wecs.panda3d.character.Inertiing(throw_exc=False)

Bases: wecs.core.System

Accelerate character, as opposed to an instantanious velocity.

Components used wecs.core.and_filter() ‘character’
entity_filters = {'character': <wecs.core.AndFilter object>}
init_entity(filter_name, entity)
destroy_entity(filter_name, entity, components_by_type)
update(entities_by_filter)
class wecs.panda3d.character.Bumping(throw_exc=False)

Bases: wecs.panda3d.character.CollisionSystem

Stop the character from moving through solid geometry.

Components used wecs.core.and_filter() ‘character’
entity_filters = {'character': <wecs.core.AndFilter object>}
init_entity(filter_name, entity)
update(entities_by_filter)
class wecs.panda3d.character.Falling(throw_exc=False)

Bases: wecs.panda3d.character.CollisionSystem

Stop the character from falling through solid geometry.

Components used wecs.core.and_filter() ‘character’
entity_filters = {'character': <wecs.core.AndFilter object>}
init_entity(filter_name, entity)
update(entities_by_filter)
predict_falling(entity)
fall_and_land(entity)
class wecs.panda3d.character.Jumping(throw_exc=False)

Bases: wecs.panda3d.character.CollisionSystem

Make the character jump.

Components used wecs.core.and_filter() ‘character’
entity_filters = {'character': <wecs.core.AndFilter object>}
update(entities_by_filter)
class wecs.panda3d.character.ExecuteMovement(throw_exc=False)

Bases: wecs.core.System

Transcribe the final intended movement to the model, making it an actual movement.

Components used wecs.core.and_filter() ‘character’
entity_filters = {'character': <wecs.core.AndFilter object>}
update(entities_by_filter)
class wecs.panda3d.character.Stamina(current: float = 100.0, maximum: float = 100.0, recovery: float = 10, crouch_drain: float = 10, move_drain: float = 10, sprint_drain: float = 10, jump_drain: float = 20)

Bases: object

This character’s movement abilities are determined by stamina.

Parameters:
  • current (float) – 100 - stamina currently left
  • maximum (float) – 100 - maximum amount of stamina
  • recovery (float) – 100 - rate of recovery (at all times)
  • crouch_drain (float) – 10 - cost of crouching
  • move_drain (float) – 10 - cost of walking
  • sprint_drain (float) – 10 - cost of sprinting (on top of walking)
  • jump_drain (float) – 20 - cost of a single jump
current = 100.0
maximum = 100.0
recovery = 10
crouch_drain = 10
move_drain = 10
sprint_drain = 10
jump_drain = 20
class wecs.panda3d.character.UpdateStamina(throw_exc=False)

Bases: wecs.core.System

Disable or allow character’s movement abilities based on stamina.

entity_filters = {'character': <wecs.core.AndFilter object>}
update(entities_by_filter)