class gbDotable
{
public:
virtual gbDotable* dotGet(const char* name)=0;
virtual void dotSet(gbDotable* value)=0;
};
class Float3 : public gbDotable
{
public:
float3& _value;
public:
Float3(float3& value) : _value(value)
{
}
public:
virtual gbDotable* dotGet(const char* name);
{
return null;
}
virtual void dotSet(const gbDotable* value)
{
_value=dynamic_cast
}
};
class gbGeom : public gbDotable
{
public:
float16 _modelMatrix;
float16 _cachedWorldMatrix;
Float16* _wrappedModelMatrix;
Float16* _wrappedCachedWorldMatrix;
public:
gbGeom()
{
_wrappedModelMatrix=new Float16(this,"rw","modelMatrix",_modelMatrix);
_wrappedCachedWorldMatrix=new Float16(this,"r","cachedWorldMatrix",_cachedWorldMatrix);
}
};
class gbBoxGeom : public gbGeom
{
public:
float3 _size;
Float3 _wrappedSize;
gbBoxGeom()
{
_wrappedSize.init(this,"r","size",&_size);
}
};
in theory you could write a matrix wrap that has other children. that wastes a lot more memory, but you could use extra functions.
class Float16_Matrix : public Float16
{
Float3* getPosition();
};
crap. more allocation issues. there are not issues as long as you can't return any values. i guess if you have a script calling a function it can be in charge of the garbage collection. maybe all the dot things need reference counters? that sounds sketchy to me.