6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/engine/standard_objects/sphere.rb', line 6
def self.create(pos: Vector[0, 0, 0], rotation: 0, scale: Vector[1, 1, 1], components: [], material: nil, parent: nil)
Engine::GameObject.create(
name: "Sphere",
pos: pos,
rotation: rotation,
scale: scale,
parent: parent,
components: [
Engine::Components::MeshRenderer.create(
mesh: Engine::Mesh.for("sphere", source: :engine),
material: material || StandardObjects.default_material
),
*components
]
)
end
|