Exemple #1
0
static void CoordInt_SetFraction(GF_Node *n, GF_Route *route)
{
	M_CoordinateInterpolator *_this = (M_CoordinateInterpolator *) n;

	if (CI_SetFraction(_this->set_fraction, &_this->value_changed, &_this->key, &_this->keyValue))
		gf_node_event_out(n, 3);//"value_changed"
}
void CoordInt_SetFraction(SFNode *n)
{
	M_CoordinateInterpolator *_this = (M_CoordinateInterpolator *) n;

	if (CI_SetFraction(_this->set_fraction, &_this->value_changed, &_this->key, &_this->keyValue)) 
		Node_OnEventOutSTR(n, "value_changed");
}
Exemple #3
0
static void NormInt_SetFraction(GF_Node *n, GF_Route *route)
{
	u32 i;
	M_NormalInterpolator *_this = (M_NormalInterpolator *) n;

	if (!CI_SetFraction(_this->set_fraction, &_this->value_changed, &_this->key, &_this->keyValue)) return;
	/*renorm*/
	for (i=0; i<_this->value_changed.count; i++) {
		gf_vec_norm(&_this->value_changed.vals[i]);
	}
	gf_node_event_out(n, 3);//"value_changed"
}
void NormInt_SetFraction(SFNode *n)
{
	u32 i;
	M_NormalInterpolator *_this = (M_NormalInterpolator *) n;

	if (!CI_SetFraction(_this->set_fraction, &_this->value_changed, &_this->key, &_this->keyValue)) return;
	/*renorm*/
	for (i=0; i<_this->value_changed.count; i++) {
		SFVec3f *v = &_this->value_changed.vals[i];
		Float res = (Float) sqrt(v->x*v->x + v->y*v->y + v->z*v->z);
		v->x /= res;
		v->y /= res;
		v->z /= res;
	}
	Node_OnEventOutSTR(n, "value_changed");
}
Exemple #5
0
Bool InitNormalInterpolator(M_NormalInterpolator *n)
{
	n->on_set_fraction = NormInt_SetFraction;
	CI_SetFraction(0, &n->value_changed, &n->key, &n->keyValue);
	return 1;
}
Exemple #6
0
Bool InitCoordinateInterpolator(M_CoordinateInterpolator *n)
{
	n->on_set_fraction = CoordInt_SetFraction;
	CI_SetFraction(0, &n->value_changed, &n->key, &n->keyValue);
	return 1;
}