added floor() and ceil() to Vector3
This commit is contained in:
parent
f697ec2fe0
commit
ec11762006
2 changed files with 29 additions and 19 deletions
|
@ -107,6 +107,8 @@ struct Vector3 {
|
|||
_FORCE_INLINE_ real_t dot(const Vector3& p_b) const;
|
||||
|
||||
_FORCE_INLINE_ Vector3 abs() const;
|
||||
_FORCE_INLINE_ Vector3 floor() const;
|
||||
_FORCE_INLINE_ Vector3 ceil() const;
|
||||
|
||||
_FORCE_INLINE_ real_t distance_to(const Vector3& p_b) const;
|
||||
_FORCE_INLINE_ real_t distance_squared_to(const Vector3& p_b) const;
|
||||
|
@ -174,6 +176,16 @@ Vector3 Vector3::abs() const {
|
|||
return Vector3( Math::abs(x), Math::abs(y), Math::abs(z) );
|
||||
}
|
||||
|
||||
Vector3 Vector3::floor() const {
|
||||
|
||||
return Vector3( Math::floor(x), Math::floor(y), Math::floor(z) );
|
||||
}
|
||||
|
||||
Vector3 Vector3::ceil() const {
|
||||
|
||||
return Vector3( Math::ceil(x), Math::ceil(y), Math::ceil(z) );
|
||||
}
|
||||
|
||||
Vector3 Vector3::linear_interpolate(const Vector3& p_b,float p_t) const {
|
||||
|
||||
return Vector3(
|
||||
|
|
|
@ -359,6 +359,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
|
|||
VCALL_LOCALMEM1R(Vector3, dot);
|
||||
VCALL_LOCALMEM1R(Vector3, cross);
|
||||
VCALL_LOCALMEM0R(Vector3, abs);
|
||||
VCALL_LOCALMEM0R(Vector3, floor);
|
||||
VCALL_LOCALMEM0R(Vector3, ceil);
|
||||
VCALL_LOCALMEM1R(Vector3, distance_to);
|
||||
VCALL_LOCALMEM1R(Vector3, distance_squared_to);
|
||||
VCALL_LOCALMEM1R(Vector3, slide);
|
||||
|
@ -1336,6 +1338,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
|
|||
ADDFUNC1(VECTOR3,REAL,Vector3,dot,VECTOR3,"b",varray());
|
||||
ADDFUNC1(VECTOR3,VECTOR3,Vector3,cross,VECTOR3,"b",varray());
|
||||
ADDFUNC0(VECTOR3,VECTOR3,Vector3,abs,varray());
|
||||
ADDFUNC0(VECTOR3,VECTOR3,Vector3,floor,varray());
|
||||
ADDFUNC0(VECTOR3,VECTOR3,Vector3,ceil,varray());
|
||||
ADDFUNC1(VECTOR3,REAL,Vector3,distance_to,VECTOR3,"b",varray());
|
||||
ADDFUNC1(VECTOR3,REAL,Vector3,distance_squared_to,VECTOR3,"b",varray());
|
||||
ADDFUNC1(VECTOR3,VECTOR3,Vector3,slide,VECTOR3,"by",varray());
|
||||
|
@ -1635,9 +1639,3 @@ void unregister_variant_methods() {
|
|||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue