Type Alias classicube_sys::Vec3

source ·
pub type Vec3 = Vec3_;

Aliased Type§

struct Vec3 {
    pub x: f32,
    pub y: f32,
    pub z: f32,
}

Fields§

§x: f32§y: f32§z: f32

Implementations§

source§

impl Vec3

source

pub const fn new(x: c_float, y: c_float, z: c_float) -> Self

source

pub const fn zero() -> Self

source

pub const fn big_pos() -> Self

source

pub const fn create(x: c_float, y: c_float, z: c_float) -> Self

source

pub fn set(&mut self, x: c_float, y: c_float, z: c_float)

source

pub fn is_zero(&self) -> bool

source

pub fn length_squared(&self) -> c_float

source

pub fn lerp(&self, b: Vec3, blend: c_float) -> Self

source

pub fn normalize(&self) -> Self

source

pub fn transform(&self, mat: Matrix) -> Self

source

pub fn transform_y(y: c_float, mat: Matrix) -> Self

source

pub fn rotate_x(v: Vec3, angle: c_float) -> Self

source

pub fn rotate_y(v: Vec3, angle: c_float) -> Self

source

pub fn rotate_y3(x: c_float, y: c_float, z: c_float, angle: c_float) -> Self

source

pub fn rotate_z(v: Vec3, angle: c_float) -> Self

source

pub fn floor(&self) -> IVec3

source

pub fn get_dir_vector(yawRad: c_float, pitchRad: c_float) -> Self

Trait Implementations§

source§

impl Add<f32> for Vec3

§

type Output = Vec3_

The resulting type after applying the + operator.
source§

fn add(self, other: c_float) -> Self

Performs the + operation. Read more
source§

impl Add for Vec3

§

type Output = Vec3_

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
source§

impl Div<f32> for Vec3

§

type Output = Vec3_

The resulting type after applying the / operator.
source§

fn div(self, other: c_float) -> Self

Performs the / operation. Read more
source§

impl Div for Vec3

§

type Output = Vec3_

The resulting type after applying the / operator.
source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
source§

impl From<IVec3_> for Vec3

source§

fn from(other: IVec3) -> Self

Converts to this type from the input type.
source§

impl Mul<f32> for Vec3

§

type Output = Vec3_

The resulting type after applying the * operator.
source§

fn mul(self, other: c_float) -> Self

Performs the * operation. Read more
source§

impl Mul for Vec3

§

type Output = Vec3_

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
source§

impl Neg for Vec3

§

type Output = Vec3_

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl Sub<f32> for Vec3

§

type Output = Vec3_

The resulting type after applying the - operator.
source§

fn sub(self, other: c_float) -> Self

Performs the - operation. Read more
source§

impl Sub for Vec3

§

type Output = Vec3_

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more