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

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