acron.actor¶
acron.actor — the object model: what a thing in the world is.
An Actor owns a NodePath (Panda’s scene graph is the only
transform store), carries declared properties (Prop descriptors —
one table per class that the inspector, the scene file, undo, replication and
blueprint pins all read), holds components (Component, typed bags
of props registered by schema name such as "acron:Collider"), and follows a
small lifecycle: construct() when built and after an edit, ready() on
its first frame, update(dt) every frame while enabled, destroy() once.
Conventions are Panda’s: Z up, rotations are (h, p, r) degrees. A live
ShowBase (the base builtin) must exist before the first actor;
offscreen buffers are fine. Collision and queries run through Bullet
(Collider, raycast(), boxcast()) — every actor with a
collider has a ghost body in the world’s own query-only Bullet world, so what
the editor shows and what the game hits are the same shape.
Generated blueprint code star-imports acron.stock (the stock actors and
input/camera/time globals), which re-exports everything public here.
|
A thing in the world. |
|
A collision shape fitted to the actor's model bounds: |
|
A bag of declared props with a lifecycle bound to its actor. |
|
Result of intersects()/raycast()/boxcast(). |
|
A declared property. |
|
All live actors, the Bullet world they collide in, and the frame step ( |
Global Functions
- actor_of(node_or_np)¶
The Actor owning a NodePath/PandaNode (walks up the graph), or None.
- actor_type(cls)¶
Register an Actor subclass for spawn-by-name and scene loading (Actor subclasses register automatically; use this for renamed lookups).
- boxcast(origin, direction=LVector3f(0, 1, 0), distance=9999, thickness=(1, 1), ignore=())¶
A thick raycast: sweeps a box of
thickness(w, h) along the ray.
- clamp(value, low, high)¶
- component(type_name)¶
Class decorator: register a Component under its namespaced schema name.
- destroy(actor, delay=0.0)¶
- distance(a, b)¶
- duplicate(actor, **props)¶
A new actor of the same class with the same saved props/components.
- find(name)¶
- lerp(a, b, t)¶
- load_model(name)¶
A fresh NodePath for
name: a primitive or a loader model (assets/ is on the model path). Raises FileNotFoundError for an unknown path.
- raycast(origin, direction=LVector3f(0, 1, 0), distance=9999, ignore=())¶
The closest collider actor along a ray (world space).
- spawn(type_name, **props)¶
Create an actor by registered class name.
- world()¶