|
|
@@ -1502,12 +1502,24 @@ function LevelEditor:add_mesh_component(id, component_id, mesh_resource, geometr
|
|
|
RenderWorld.mesh_create(self._rw, unit_id, mesh_resource, geometry_name, material_resource, visible, unit_box:world_pose())
|
|
|
end
|
|
|
|
|
|
+function LevelEditor:add_sprite_component(id, component_id, sprite_resource, material_resource, visible)
|
|
|
+ local unit_box = self._objects[id]
|
|
|
+ local unit_id = unit_box:unit_id();
|
|
|
+ RenderWorld.sprite_create(self.rw, unit_id, sprite_resource, material_resource, visible, unit_box:world_pose())
|
|
|
+end
|
|
|
+
|
|
|
function LevelEditor:add_light_component(id, component_id, type, range, intensity, spot_angle, color)
|
|
|
local unit_box = self._objects[id]
|
|
|
local unit_id = unit_box:unit_id()
|
|
|
RenderWorld.light_create(self._rw, unit_id, type, range, intensity, spot_angle, color, unit_box:world_pose())
|
|
|
end
|
|
|
|
|
|
+function LevelEditor:add_camera_component(id, component_id, projection, fov, far_range, near_range)
|
|
|
+ local unit_box = self._objects[id]
|
|
|
+ local unit_id = unit_box:unit_id();
|
|
|
+ World.camera_create(self.rw, unit_id, projection, fov, far_range, near_range, unit_box:world_pose());
|
|
|
+end
|
|
|
+
|
|
|
function LevelEditor:move_object(id, pos, rot, scale)
|
|
|
local unit_box = self._objects[id]
|
|
|
unit_box:set_local_position(pos)
|