feat(rtlisp): clean up rt lisp functions
- sin/cos - scene-add proxy
This commit is contained in:
parent
88bbcf036f
commit
1871f6cae4
@ -165,6 +165,16 @@ pub fn render(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[native_lisp_function(eval)]
|
||||||
|
pub fn sin(x: f64) -> Result<f64, EvalError> {
|
||||||
|
Ok(x.sin())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[native_lisp_function(eval)]
|
||||||
|
pub fn cos(x: f64) -> Result<f64, EvalError> {
|
||||||
|
Ok(x.cos())
|
||||||
|
}
|
||||||
|
|
||||||
#[native_lisp_function]
|
#[native_lisp_function]
|
||||||
pub fn vadd_vv(
|
pub fn vadd_vv(
|
||||||
a: ForeignDataWrapper<Vector3>,
|
a: ForeignDataWrapper<Vector3>,
|
||||||
@ -261,16 +271,11 @@ pub fn mk_raytrace(layer: &mut EnvironmentLayer) {
|
|||||||
);
|
);
|
||||||
layer.set("sphere".to_string(), Expression::Function(sphere));
|
layer.set("sphere".to_string(), Expression::Function(sphere));
|
||||||
layer.set("scene".to_string(), Expression::Function(scene));
|
layer.set("scene".to_string(), Expression::Function(scene));
|
||||||
layer.set(
|
layer.set("scene-add".to_string(), Expression::Function(scene_add));
|
||||||
"scene-add-object".to_string(),
|
|
||||||
Expression::Function(scene_add_object),
|
|
||||||
);
|
|
||||||
layer.set(
|
|
||||||
"scene-add-light".to_string(),
|
|
||||||
Expression::Function(scene_add_light),
|
|
||||||
);
|
|
||||||
layer.set("camera".to_string(), Expression::Function(camera));
|
layer.set("camera".to_string(), Expression::Function(camera));
|
||||||
layer.set("render".to_string(), Expression::Function(render));
|
layer.set("render".to_string(), Expression::Function(render));
|
||||||
|
layer.set("sin".to_string(), Expression::Function(sin));
|
||||||
|
layer.set("cos".to_string(), Expression::Function(cos));
|
||||||
layer.set("vadd".to_string(), Expression::Function(vadd));
|
layer.set("vadd".to_string(), Expression::Function(vadd));
|
||||||
layer.set("vsub".to_string(), Expression::Function(vsub));
|
layer.set("vsub".to_string(), Expression::Function(vsub));
|
||||||
layer.set("vmul".to_string(), Expression::Function(vmul));
|
layer.set("vmul".to_string(), Expression::Function(vmul));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user