pub struct Geometry { /* private fields */ }Implementations§
source§impl Geometry
impl Geometry
sourcepub fn add_polygon(
&self,
direct_occlusion: c_float,
reverb_occlusion: c_float,
double_sided: bool,
vertices: &[Vector],
) -> Result<c_int>
pub fn add_polygon( &self, direct_occlusion: c_float, reverb_occlusion: c_float, double_sided: bool, vertices: &[Vector], ) -> Result<c_int>
Adds a polygon.
All vertices must lay in the same plane otherwise behavior may be unpredictable. The polygon is assumed to be convex. A non convex polygon will produce unpredictable behavior. Polygons with zero area will be ignored.
Polygons cannot be added if already at the maximum number of polygons or if the addition of their verticies would result in exceeding the maximum number of vertices.
Vertices of an object are in object space, not world space, and so are relative to the position, or center of the object.
See [Geometry::setP_psition].
sourcepub fn set_active(&self, active: bool) -> Result<()>
pub fn set_active(&self, active: bool) -> Result<()>
Sets whether an object is processed by the geometry engine.
sourcepub fn get_active(&self) -> Result<bool>
pub fn get_active(&self) -> Result<bool>
Retrieves whether an object is processed by the geometry engine.
sourcepub fn get_max_polygons(&self) -> Result<(c_int, c_int)>
pub fn get_max_polygons(&self) -> Result<(c_int, c_int)>
Retrieves the maximum number of polygons and vertices allocatable for this object.
The maximum number was set with crate::System::create_geometry.
sourcepub fn get_polygon_count(&self) -> Result<c_int>
pub fn get_polygon_count(&self) -> Result<c_int>
Retrieves the number of polygons in this object.
pub fn set_raw_userdata(&self, userdata: *mut c_void) -> Result<()>
pub fn get_raw_userdata(&self) -> Result<*mut c_void>
source§impl Geometry
impl Geometry
pub fn set_userdata(&self, userdata: Userdata) -> Result<()>
pub fn get_userdata(&self) -> Result<Option<Userdata>>
source§impl Geometry
impl Geometry
sourcepub fn set_polygon_attributes(
&self,
index: c_int,
direct_occlusion: c_float,
reverb_occlusion: c_float,
double_sided: bool,
) -> Result<()>
pub fn set_polygon_attributes( &self, index: c_int, direct_occlusion: c_float, reverb_occlusion: c_float, double_sided: bool, ) -> Result<()>
Sets individual attributes for a polygon inside a geometry object.
sourcepub fn get_polygon_attributes(
&self,
index: c_int,
) -> Result<(c_float, c_float, bool)>
pub fn get_polygon_attributes( &self, index: c_int, ) -> Result<(c_float, c_float, bool)>
Retrieves the attributes for a polygon.
sourcepub fn get_polygon_vertex_count(&self, index: c_int) -> Result<c_int>
pub fn get_polygon_vertex_count(&self, index: c_int) -> Result<c_int>
Gets the number of vertices in a polygon.
sourcepub fn set_polygon_vertex(
&self,
index: c_int,
vertex_index: c_int,
vertex: Vector,
) -> Result<()>
pub fn set_polygon_vertex( &self, index: c_int, vertex_index: c_int, vertex: Vector, ) -> Result<()>
Alters the position of a polygon’s vertex inside a geometry object.
Vertices are relative to the position of the object. See Geometry::set_position.
There may be some significant overhead with this function as it may cause some reconfiguration of internal data structures used to speed up sound-ray testing.
You may get better results if you want to modify your object by using Geometry::set_position, Geometry::set_scale and Geometry::set_rotation.
source§impl Geometry
impl Geometry
sourcepub fn set_position(&self, position: Vector) -> Result<()>
pub fn set_position(&self, position: Vector) -> Result<()>
Sets the 3D position of the object.
Position is in world space.
sourcepub fn get_position(&self) -> Result<Vector>
pub fn get_position(&self) -> Result<Vector>
Retrieves the 3D position of the object.
Position is in world space.
sourcepub fn set_rotation(&self, forward: Vector, up: Vector) -> Result<()>
pub fn set_rotation(&self, forward: Vector, up: Vector) -> Result<()>
Sets the 3D orientation of the object.
See remarks in crate::System::set_3d_listener_attributes for more description on forward and up vectors.
sourcepub fn get_rotation(&self) -> Result<(Vector, Vector)>
pub fn get_rotation(&self) -> Result<(Vector, Vector)>
Retrieves the 3D orientation of the object.