rlzero.Sphere
- class rlzero.Sphere(position=(0, 0, 0), radius=10, color=(230, 41, 55, 255), wires=False, wire_color=(80, 80, 80, 255))
Model with sphere shaped mesh generated rather than loaded from file.
- __init__(position=(0, 0, 0), radius=10, color=(230, 41, 55, 255), wires=False, wire_color=(80, 80, 80, 255))
- Parameters
model_file –
position –
collision_radius –
texture_file –
rotation_axis –
rotation_angle –
size –
color –
wires –
wire_color –
Methods
__init__([position, radius, 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
colorBase Color of the object.
posPosition Vector in 3d space.
sizeMultiply the size of the object by this float.
wire_colorIf drawing wireframe, use this Color.
xShortcut to the x co-ordinate float of the object position
yShortcut to the y co-ordinate float of the object position
zShortcut to the z co-ordinate float of the object position