7 #ifndef __surface_SurfaceSphere_h__ 8 #define __surface_SurfaceSphere_h__ 27 public SurfaceBase::Impact,
34 #if FE_COUNTED_STORE_TRACKER 35 setName(
"SurfaceSphere::Impact");
38 virtual ~Impact(
void) {}
40 virtual void reset(
void)
51 return transformVector(m_transform,
60 return m_intersection;
62 virtual void setIntersectionLocal(
64 { m_intersection=a_intersection; }
72 return rotateVector(m_transform,m_normal);
75 { m_normal=a_normal; }
79 virtual void resolve(
void)
82 spSurfaceSphere(m_hpSurface);
83 if(spSurfaceSphere.isValid())
85 spSurfaceSphere->resolveImpact(
109 virtual Real radius(
void)
112 virtual Real radius(
void)
const 116 using SurfaceBase::sample;
120 using SurfaceBase::nearestPoint;
123 Real a_maxDistance)
const 128 m_center,m_radius,a_origin,direction);
129 if(a_maxDistance>0.0 && distance>a_maxDistance)
135 FEASSERT(spImpact.isValid());
137 spImpact->setSurface(
this);
138 spImpact->setLocationLocal(m_center);
139 spImpact->setDiffuse(m_diffuse);
140 spImpact->setRadius(m_radius);
141 spImpact->setOrigin(a_origin);
142 spImpact->setDirection(direction);
143 spImpact->setDistance(distance);
148 using SurfaceBase::rayImpact;
152 Real a_maxDistance,BWORD a_anyHit)
const 157 a_origin,a_direction);
160 (a_maxDistance>0.0 &&
161 distance>a_maxDistance))
167 FEASSERT(spImpact.isValid());
169 spImpact->setSurface(
this);
170 spImpact->setLocationLocal(m_center);
171 spImpact->setDiffuse(m_diffuse);
172 spImpact->setRadius(m_radius);
173 spImpact->setOrigin(a_origin);
174 spImpact->setDirection(a_direction);
175 spImpact->setDistance(distance);
189 virtual void bind(
Record& rRecord);
191 void setRadius(Real a_radius)
192 { m_radius=a_radius; }
194 { m_center=a_rCenter; }
198 virtual void cache(
void);
199 virtual void resolveImpact(
sp<ImpactI> a_spImpactI)
const 206 spImpact->locationLocal(),
209 spImpact->direction(),
210 spImpact->distance(),
211 intersection,normal);
212 spImpact->setIntersectionLocal(intersection);
213 spImpact->setNormalLocal(normal);
virtual void draw(sp< DrawI > a_spDrawI, const fe::Color *a_pColor)
Draw with current settings.
Definition: SurfaceBase.h:590
Base class providing protection counting for cp<>
Definition: Protectable.h:28
kernel
Definition: namespace.dox:3
Special vector for color (RGBA)
Definition: Color.h:21
virtual void bind(Instance a_instance)
associate with model data
Definition: SurfaceBase.h:175
Find nearest point on sphere.
Definition: PointSphereNearest.h:21
virtual Color diffuse(void) const
Return the diffuse color.
Definition: SurfaceSphere.h:114
Spherical Surface.
Definition: SurfaceSphere.h:20
Find intersection between ray and sphere.
Definition: RaySphereIntersect.h:21
Trivial Point Origin Surface.
Definition: SurfaceBase.h:20
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192
Non-persistent reference to an instance of a Layout.
Definition: WeakRecordSB.h:17