rlzero.Cube
- class rlzero.Cube(position=(0, 0, 0), size=(10, 10, 10), color=(255, 255, 255, 255), wires=False, wire_color=(80, 80, 80, 255), rotation_axis=[0, 1, 0], rotation_angle=0)
Model with cube shaped mesh generated rather than loaded from file.
- __init__(position=(0, 0, 0), size=(10, 10, 10), color=(255, 255, 255, 255), wires=False, wire_color=(80, 80, 80, 255), rotation_axis=[0, 1, 0], rotation_angle=0)
- Parameters
model_file –
position –
collision_radius –
texture_file –
rotation_axis –
rotation_angle –
size –
color –
wires –
wire_color –
Methods
__init__
([position, size, color, wires, …])- param model_file
calc_bounding_box
()Calculates a box big enough to contain the object.
calc_centre
()Calculates the centre of the object.
check_collision
(other)Check if the object is currently colliding with another object
draw
()Draws the object.
load_data
()Loads the 3d model data from glb file on disk.
load_data_obj
()Loads the 3d model data from obj file on disk.
Attributes
color
Base Color of the object.
pos
Position Vector in 3d space.
size
Multiply the size of the object by this float.
wire_color
If drawing wireframe, use this Color.
x
Shortcut to the x co-ordinate float of the object position
y
Shortcut to the y co-ordinate float of the object position
z
Shortcut to the z co-ordinate float of the object position