Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EDITOR_ENTITY
- ({
- name = "env_global",
- label = "Global environment",
- params =
- [
- { name = "fog_color", label = "Fog color", type = "vec3", default = vec3(0.5,0.5,0.5) },
- { name = "fog_density", label = "Fog density", type = "float", default = 0.01 },
- { name = "fog_height_density", label = "Fog height density", type = "float", default = 0 },
- { name = "fog_start_height", label = "Fog start height", type = "float", default = 0 },
- { name = "fog_height_factor", label = "Fog height factor", type = "float", default = 0 },
- { name = "ambient_light_color", label = "Ambient light color", type = "vec3", default = vec3(0.1,0.1,0.1) },
- ],
- item_list = function( data )
- {
- fc = data.fog_color;
- alc = @data.ambient_light_color;
- return [{ type = "env",
- fog_color = vec3(fc.x,fc.y,fc.z),
- fog_density = data.fog_density,
- fog_height_density = data.fog_height_density,
- fog_start_height = data.fog_start_height,
- fog_height_factor = data.fog_height_factor,
- ambient_light_color = vec3(alc.x,alc.y,alc.z),
- }];
- },
- });
- EDITOR_ENTITY
- ({
- name = "static_mesh",
- label = "Static mesh",
- params =
- [
- { name = "position", type = "position" },
- { name = "mesh", type = "path.file.mesh" },
- ],
- item_list = function( data )
- {
- dp = data.position;
- return [{ type = "mesh", src = data.mesh, position = vec3(dp.x,dp.y,dp.z) }];
- },
- });
- EDITOR_ENTITY
- ({
- name = "point_light",
- label = "Point light",
- params =
- [
- { name = "position", type = "position" },
- { name = "color", type = "vec3", default = vec3(1,1,1) },
- { name = "range", type = "float", default = 100.0 },
- { name = "power", type = "float", default = 1.0 },
- { name = "enabled", type = "bool", default = true },
- ],
- render_wire = function( ctx, data )
- {
- },
- item_list = function( data )
- {
- dp = data.position;
- dc = data.color;
- return [{ type = "point_light", position = vec3(dp.x,dp.y,dp.z), color = vec3(dc.x,dc.y,dc.z), range = data.range, power = data.power, enabled = data.enabled }];
- },
- });
- EDITOR_ENTITY
- ({
- name = "portal",
- label = "Portal",
- params =
- [
- { name = "x", type = "position.x" },
- { name = "y", type = "position.y" },
- { name = "z", type = "position.z" },
- { name = "d", label = "Diameter", type = "float", default = 2.88 },
- { name = "h", label = "Height", type = "float", default = 18.432 },
- ],
- render_wire = function( ctx, data )
- {
- ctx.DrawCapsule( data.x, data.y, data.z - data.h * 0.5, data.x, data.y, data.z + data.h * 0.5, data.d * 0.5 );
- ctx.DrawLine( data.x, data.y, data.z - data.h * 0.5, data.x, data.y, data.z + data.h * 0.5 );
- },
- item_list = function( data )
- {
- r = data.d / 2;
- return
- [
- { type = "mesh", src = "portal", position = vec3(data.x,data.y,data.z-data.h*0.5), scale = vec3(r,r,1) },
- { type = "mesh", src = "portal", position = vec3(data.x,data.y,data.z+data.h*0.5), scale = vec3(r,r,1) },
- ];
- },
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement