Hello Carsten,
Thanks a lot for your precious pieces of advice!
The Framework developement is going on, but I'm facing problems when I
have to deal with multifields inside a field container.
As you may know, in my framework there are three kinds of control points:
1 - Control Points containing a single field (i.e.
ControlPoint<SField<Vec3f>>)
2 - Control Points containing a multi field (i.e.
ControlPoint<MField<Vec3f>>)
3 - Control Points containing the whole field container (i.e.
ControlPoint<ComponentTransformPtr>)
In the first two cases everything seems to work fine, while in the last
one I have a problem with multi fields.
Here's how things work when I interpolate between two control points
containing a FieldContainer:
// 'size' is the number of fields to deal with.
// 'fc_ptr_dst' is the field container to be updated.
// 'fc_src0' and 'fc_src1' are the field containers held inside the
two controlpoints to interpolate between.
// 'TypeIdentifier' is a class containing a
'FieldValueInterpolator<>' object for every kind of datatype.
TypeIdentifier* ti = TypeIdentifier::Instantiate();
for ( Int32 i = 0 ; (UInt32)i < size ; i++ )
{
f = fc_ptr_dst->getField(vID[i]);
f0 = fc_src0->getField(vID[i]);
f1 = fc_src1->getField(vID[i]);
FieldValueInterpolatorBase* fvib =
ti->getFieldValueInterpolator(f->getType().getId());
if ( fvib == NULL ) continue ;
fvib->updateField(ratio, f0, f1, fc_ptr_dst, vID[i], int_type);
}
Since multifields inside a field container are stored as singlefields of
'FieldContainerPtr' type, and I get a field via the getField() method,
how am I supposed to know if I'm dealing with a FieldContainer or not ?
I have tried with
f->getContentType().isDerivedFrom(FieldContainer::getClassType()) and
f->getType().isDerivedFrom(FieldContainer::getClassType()),
but they both seem to return FALSE even if 'f' actually IS a
FieldContainer (i.e. a GeoPositionsPtr)...
Notice that everything works fine when it is known which multifield is
to be dealt with, because the right fieldcontainer is supplied to the
AnimationController at compile time!
Any suggestion would be highly welcome !!!!
Cheers,
Carlo
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core