Text archives Help
- From: boulos@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1674 - trunk/Model/Instances
- Date: Tue, 21 Aug 2007 10:37:44 -0600 (MDT)
Author: boulos
Date: Tue Aug 21 10:37:43 2007
New Revision: 1674
Modified:
trunk/Model/Instances/Instance.cc
trunk/Model/Instances/Instance.h
Log:
Model/Instances/Instance.cc
Model/Instances/Instance.h
Adding setTransform so that the transform of an instance can be
changed during a callback (allows for simple affine movements of objects)
Modified: trunk/Model/Instances/Instance.cc
==============================================================================
--- trunk/Model/Instances/Instance.cc (original)
+++ trunk/Model/Instances/Instance.cc Tue Aug 21 10:37:43 2007
@@ -59,6 +59,11 @@
{
}
+void Instance::setTransform(AffineTransform new_transform) {
+ transform = new_transform;
+ transform_inv = transform.inverse();
+}
+
void Instance::preprocess(const PreprocessContext& context)
{
//cerr << MANTA_FUNC << endl;
Modified: trunk/Model/Instances/Instance.h
==============================================================================
--- trunk/Model/Instances/Instance.h (original)
+++ trunk/Model/Instances/Instance.h Tue Aug 21 10:37:43 2007
@@ -44,6 +44,9 @@
Instance(Object* instance, const AffineTransform& transform);
virtual ~Instance();
+ // Functions for callbacks (must be pass by value)
+ void setTransform(AffineTransform new_transform);
+
// Generic
virtual void preprocess(const PreprocessContext&);
virtual void computeBounds(const PreprocessContext& context,
@@ -56,17 +59,17 @@
// From TexCoordMapper
virtual void computeTexCoords2(const RenderContext& context,
- RayPacket& rays) const;
+ RayPacket& rays) const;
virtual void computeTexCoords3(const RenderContext& context,
- RayPacket& rays) const;
+ RayPacket& rays) const;
private:
Object* instance;
const TexCoordMapper* tex;
- // Transformation and its inverse.
+ // Transformation and its inverse.
AffineTransform transform;
- AffineTransform transform_inv;
+ AffineTransform transform_inv;
};
}
- [Manta] r1674 - trunk/Model/Instances, boulos, 08/21/2007
Archive powered by MHonArc 2.6.16.