(ctx: &mut ScriptContext<'_, API>)
| 2198 | scale: Vector3, |
| 2199 | rotation: Quaternion, |
| 2200 | ) { |
| 2201 | let _ = create_editor_mesh_child( |
| 2202 | ctx, |
| 2203 | parent, |
| 2204 | "__editor_selected_axis", |
| 2205 | "__cube__", |
| 2206 | material, |
| 2207 | Transform3D::new(position, rotation, scale), |
| 2208 | ); |
| 2209 | } |
| 2210 | |
| 2211 | fn add_collision_vertices_3d<API: ScriptAPI + ?Sized>( |
| 2212 | ctx: &mut ScriptContext<'_, API>, |
| 2213 | parent: NodeID, |
| 2214 | material: MaterialID, |
| 2215 | shape: &Shape3D, |
| 2216 | ) { |
| 2217 | for point in collision_shape_vertex_points(shape) { |
| 2218 | let _ = create_editor_mesh_child( |
| 2219 | ctx, |
| 2220 | parent, |
| 2221 | "__editor_collision3d_vertex", |
| 2222 | "__cube__", |
| 2223 | material, |
| 2224 | Transform3D::new( |
| 2225 | point, |
| 2226 | Quaternion::IDENTITY, |
| 2227 | Vector3::new(0.075, 0.075, 0.075), |
| 2228 | ), |
| 2229 | ); |
| 2230 | } |
| 2231 | } |
| 2232 | |
| 2233 | fn collision_shape_vertex_points(shape: &Shape3D) -> Vec<Vector3> { |
| 2234 | match shape { |
| 2235 | Shape3D::Cube { size } => { |
| 2236 | let hx = size.x.abs() * 0.5; |
no test coverage detected