pub struct Arrow {
pub line: Line,
pub mesh: Mesh,
pub radius: f32,
pub guid: String,
pub name: String,
pub xform: Xform,
}
Expand description
An arrow geometry defined by a line and radius, the head is uniformly scaled.
The arrow is generated as a 10-sided cylinder body and an 8-sided cone head that is oriented along the line direction and scaled to match the line length and specified radius.
Fields§
§line: Line
§mesh: Mesh
§radius: f32
§guid: String
§name: String
§xform: Xform
Implementations§
Source§impl Arrow
impl Arrow
fn create_arrow_mesh(line: &Line, radius: f32) -> Mesh
fn unit_cylinder_geometry() -> (Vec<Point>, Vec<[usize; 3]>)
fn unit_cone_geometry() -> (Vec<Point>, Vec<[usize; 3]>)
Sourcepub fn jsondump(&self) -> Result<String, Box<dyn Error>>
pub fn jsondump(&self) -> Result<String, Box<dyn Error>>
Serializes the Arrow to a JSON string.
Sourcepub fn jsonload(json_data: &str) -> Result<Self, Box<dyn Error>>
pub fn jsonload(json_data: &str) -> Result<Self, Box<dyn Error>>
Deserializes an Arrow from a JSON string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Arrow
impl<'de> Deserialize<'de> for Arrow
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Arrow
impl RefUnwindSafe for Arrow
impl Send for Arrow
impl Sync for Arrow
impl Unpin for Arrow
impl UnwindSafe for Arrow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more