Render model component state helpers

This commit is contained in:
Benjamin Saunders
2017-07-17 21:09:45 -07:00
parent 8894438fd8
commit 0c3affc00d

View File

@ -239,6 +239,14 @@ pub struct ComponentState {
pub properties: ComponentProperties, pub properties: ComponentProperties,
} }
impl ComponentState {
pub fn is_static(&self) -> bool { self.properties & component_properties::IS_STATIC != 0 }
pub fn is_visible(&self) -> bool { self.properties & component_properties::IS_VISIBLE != 0 }
pub fn is_touched(&self) -> bool { self.properties & component_properties::IS_TOUCHED != 0 }
pub fn is_pressed(&self) -> bool { self.properties & component_properties::IS_PRESSED != 0 }
pub fn is_scrolled(&self) -> bool { self.properties & component_properties::IS_SCROLLED != 0 }
}
type ComponentProperties = sys::VRComponentProperties; type ComponentProperties = sys::VRComponentProperties;
pub mod component_properties { pub mod component_properties {