peng3d.actor.player - Player Actors¶
-
class
peng3d.actor.player.BasicPlayer(peng, world, uuid=None, pos=[0, 0, 0], rot=[0, 0])[source]¶ Basic Player class, subclass of
RotatableActor().This class adds no features currently, it can be used to identify player actors via
isinstance().
-
class
peng3d.actor.player.FirstPersonPlayer(peng, world, uuid=None, pos=[0, 0, 0], rot=[0, 0])[source]¶ Old class allowing to create standard first-person players easily.
Deprecated: See EgoMouseRotationalController()andFourDirectionalMoveController()instead
-
class
peng3d.actor.player.FourDirectionalMoveController(*args, **kwargs)[source]¶ Controller allowing the user to control the actor with the keyboard.
You can configure the used keybinds with the
controls.controls.forwardetc. The keybinds can also be changed with theirkeybindname, e.g.peng3d:actor.<actor uuid>.player.controls.forwardfor forward.The movement speed may also be changed via the
movespeedinstance attribute, which defaults tocontrols.controls.movespeed.You may also access the currently held keys via
move, which is a list with 2 items, forwards/backwards and left/right.-
get_motion_vector()[source]¶ Returns the movement vector according to held buttons and the rotation.
Returns: 3-Tuple of (dx,dy,dz)Return type: tuple
-
registerEventHandlers()[source]¶ Registers needed keybinds and schedules the
update()Method.You can control what keybinds are used via the
controls.controls.forwardetc. Configuration Values.
-
-
class
peng3d.actor.player.EgoMouseRotationalController(*args, **kwargs)[source]¶ Controller allowing the user to rotate the actor with the mouse.
-
class
peng3d.actor.player.BasicFlightController(*args, **kwargs)[source]¶ Controller allowing the user to move up and down with the jump and crouch controls.
The used keybinds may be configured via
controls.controls.crouchandcontrols.controls.jump.The vertical speed used when flying may be configured via
controls.controls.verticalspeedor thespeedattribute.