Esempio n. 1
0
/* Floating-point trigonometric starting value.
 * See the ARM ARM pseudocode function FPTrigSMul.
 */
static float16 float16_ftsmul(float16 op1, uint16_t op2, float_status *stat)
{
    float16 result = float16_mul(op1, op1, stat);
    if (!float16_is_any_nan(result)) {
        result = float16_set_sign(result, op2 & 1);
    }
    return result;
}
Esempio n. 2
0
void model_convert_bone2world_to_skin2world(float bones[][16], STB3D_Model *model)
{
   int i;
   for (i=0; i < model->num_bones; ++i) {
      float temp[16];
      memcpy(temp, bones[i], sizeof(temp));
      float16_mul(bones[i], model->bones[i].bind_xform, temp);
   }
}
Esempio n. 3
0
void model_convert_bonelocal_to_bone2world(float bones[][16], STB3D_Model *model, STB3D_ModelTransform *raw_bones)
{
   int i;
   for (i=0; i < model->num_bones; ++i) {
      int n = model->bones[i].parent;
      float local[16];
      float16_from_quat_vec(local, raw_bones[i].rot_quat, raw_bones[i].translate);
      if (n >= 0) {
         float16_mul(bones[i], local, bones[n]);
      } else {
         memcpy(bones[i], local, sizeof(bones[i]));
      }
   }
}