Новые методы для мОторов
This commit is contained in:
parent
b85a554cb8
commit
f7e0b1cff5
2 changed files with 49 additions and 0 deletions
|
|
@ -27,6 +27,46 @@ inline void bt_motor_reset_fp64(BtMotorFP64* motor)
|
|||
bgc_vector3_reset_fp64(&motor->momentum);
|
||||
}
|
||||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bt_motor_copy_fp32(const BtMotorFP32* source, BtMotorFP32* destination)
|
||||
{
|
||||
bgc_vector3_copy_fp32(&source->vector, &destination->vector);
|
||||
bgc_vector3_copy_fp32(&source->momentum, &destination->momentum);
|
||||
}
|
||||
|
||||
inline void bt_motor_copy_fp64(const BtMotorFP64* source, BtMotorFP64* destination)
|
||||
{
|
||||
bgc_vector3_copy_fp64(&source->vector, &destination->vector);
|
||||
bgc_vector3_copy_fp64(&source->momentum, &destination->momentum);
|
||||
}
|
||||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bt_motor_convert_fp64_to_fp32(const BtMotorFP64* source, BtMotorFP32* destination)
|
||||
{
|
||||
bgc_vector3_convert_fp64_to_fp32(&source->vector, &destination->vector);
|
||||
bgc_vector3_convert_fp64_to_fp32(&source->momentum, &destination->momentum);
|
||||
}
|
||||
|
||||
inline void bt_motor_convert_fp32_to_fp64(const BtMotorFP32* source, BtMotorFP64* destination)
|
||||
{
|
||||
bgc_vector3_convert_fp32_to_fp64(&source->vector, &destination->vector);
|
||||
bgc_vector3_convert_fp32_to_fp64(&source->momentum, &destination->momentum);
|
||||
}
|
||||
|
||||
// ================== Is Zero =================== //
|
||||
|
||||
inline int bt_motor_is_zero_fp32(const BtMotorFP32* motor)
|
||||
{
|
||||
return bgc_vector3_is_zero_fp32(&motor->vector) && bgc_vector3_is_zero_fp32(&motor->momentum);
|
||||
}
|
||||
|
||||
inline int bt_motor_is_zero_fp64(const BtMotorFP64* motor)
|
||||
{
|
||||
return bgc_vector3_is_zero_fp64(&motor->vector) && bgc_vector3_is_zero_fp64(&motor->momentum);
|
||||
}
|
||||
|
||||
// ================= Is Vector ================== //
|
||||
|
||||
inline int bt_motor_is_vector_fp32(const BtMotorFP32* motor)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue