/// <summary> /// Set component value of specified type /// </summary> /// <param name="component">The component to set</param> /// <param name="value">The new value of the component</param> private void SetComponent(VecComponent component, float value) { // Vector was created by the user if (_handle == IntPtr.Zero) { switch (component) { case VecComponent.X: _x = value; return; case VecComponent.Y: _y = value; return; case VecComponent.Z: _z = value; return; } } else { set_vector3_component(_handle, component, value); } }
/// <summary> /// Get component value of specified type /// </summary> /// <param name="component">The component to get</param> /// <returns>Value of component</returns> private float GetComponent(VecComponent component) { // Vector was created by the user if (_handle == IntPtr.Zero) { switch (component) { case VecComponent.X: return(_x); case VecComponent.Y: return(_y); case VecComponent.Z: return(_z); } return(0.0f); } else { return(get_vector3_component(_handle, component)); } }