@ -194,7 +194,7 @@ void CPSZonePlane::deleteElement(uint32 index)
}
}
void CPSZonePlane : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector * posBefore , const NLMISC : : CVector * posAfter )
void CPSZonePlane : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector Packed * posBefore , const NLMISC : : CVector Packed * posAfter )
{
{
NL_PS_FUNC ( CPSZonePlane_computeCollisions )
NL_PS_FUNC ( CPSZonePlane_computeCollisions )
MINI_TIMER ( PSStatsZonePlane )
MINI_TIMER ( PSStatsZonePlane )
@ -213,9 +213,9 @@ void CPSZonePlane::computeCollisions(CPSLocated &target, uint firstInstanceIndex
NLMISC : : CPlane p ;
NLMISC : : CPlane p ;
p . make ( m . mulVector ( * normalIt ) , m * ( * planePosIt ) ) ;
p . make ( m . mulVector ( * normalIt ) , m * ( * planePosIt ) ) ;
// deals with each particle
// deals with each particle
const NLMISC : : CVector * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector Packed * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector * itPosAfter = posAfter + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosAfter = posAfter + firstInstanceIndex ;
while ( itPosBefore ! = itPosBeforeEnd )
while ( itPosBefore ! = itPosBeforeEnd )
{
{
float posSide = p * * itPosBefore ;
float posSide = p * * itPosBefore ;
@ -235,7 +235,7 @@ void CPSZonePlane::computeCollisions(CPSLocated &target, uint firstInstanceIndex
ci . Dist = startEnd . norm ( ) ;
ci . Dist = startEnd . norm ( ) ;
// we translate the particle from an epsilon so that it won't get hooked to the plane
// we translate the particle from an epsilon so that it won't get hooked to the plane
ci . NewPos = * itPosBefore + startEnd + PSCollideEpsilon * p . getNormal ( ) ;
ci . NewPos = * itPosBefore + startEnd + PSCollideEpsilon * p . getNormal ( ) ;
const CVector & speed = target . getSpeed ( ) [ ( uint32 ) ( itPosBefore - posBefore ) ] ;
const CVector speed = target . getSpeed ( ) [ ( uint32 ) ( itPosBefore - posBefore ) ] ;
ci . NewSpeed = _BounceFactor * ( speed - 2.0f * ( speed * p . getNormal ( ) ) * p . getNormal ( ) ) ;
ci . NewSpeed = _BounceFactor * ( speed - 2.0f * ( speed * p . getNormal ( ) ) * p . getNormal ( ) ) ;
ci . CollisionZone = this ;
ci . CollisionZone = this ;
CPSLocated : : _Collisions [ itPosBefore - posBefore ] . update ( ci ) ;
CPSLocated : : _Collisions [ itPosBefore - posBefore ] . update ( ci ) ;
@ -290,7 +290,7 @@ void CPSZonePlane::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
// sphere implementation //
// sphere implementation //
///////////////////////////
///////////////////////////
void CPSZoneSphere : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector * posBefore , const NLMISC : : CVector * posAfter )
void CPSZoneSphere : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector Packed * posBefore , const NLMISC : : CVector Packed * posAfter )
{
{
NL_PS_FUNC ( CPSZoneSphere_computeCollisions )
NL_PS_FUNC ( CPSZoneSphere_computeCollisions )
MINI_TIMER ( PSStatsZoneSphere )
MINI_TIMER ( PSStatsZoneSphere )
@ -308,9 +308,9 @@ void CPSZoneSphere::computeCollisions(CPSLocated &target, uint firstInstanceInde
const CMatrix & m = CPSLocated : : getConversionMatrix ( & target , this - > _Owner ) ;
const CMatrix & m = CPSLocated : : getConversionMatrix ( & target , this - > _Owner ) ;
CVector center = m * * spherePosIt ;
CVector center = m * * spherePosIt ;
// deals with each particle
// deals with each particle
const NLMISC : : CVector * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector Packed * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector * itPosAfter = posAfter + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosAfter = posAfter + firstInstanceIndex ;
while ( itPosBefore ! = itPosBeforeEnd )
while ( itPosBefore ! = itPosBeforeEnd )
{
{
// check whether the located is going through the sphere
// check whether the located is going through the sphere
@ -346,7 +346,7 @@ void CPSZoneSphere::computeCollisions(CPSLocated &target, uint firstInstanceInde
ci . Dist = startEnd . norm ( ) ;
ci . Dist = startEnd . norm ( ) ;
// we translate the particle from an epsilon so that it won't get hooked to the sphere
// we translate the particle from an epsilon so that it won't get hooked to the sphere
ci . NewPos = pos + startEnd + PSCollideEpsilon * normal ;
ci . NewPos = pos + startEnd + PSCollideEpsilon * normal ;
const CVector & speed = target . getSpeed ( ) [ ( uint32 ) ( itPosBefore - posBefore ) ] ;
const CVector speed = target . getSpeed ( ) [ ( uint32 ) ( itPosBefore - posBefore ) ] ;
ci . NewSpeed = _BounceFactor * ( speed - 2.0f * ( speed * normal ) * normal ) ;
ci . NewSpeed = _BounceFactor * ( speed - 2.0f * ( speed * normal ) * normal ) ;
ci . CollisionZone = this ;
ci . CollisionZone = this ;
CPSLocated : : _Collisions [ itPosBefore - posBefore ] . update ( ci ) ;
CPSLocated : : _Collisions [ itPosBefore - posBefore ] . update ( ci ) ;
@ -450,7 +450,7 @@ void CPSZoneSphere::deleteElement(uint32 index)
////////////////////////////////
////////////////////////////////
// CPSZoneDisc implementation //
// CPSZoneDisc implementation //
////////////////////////////////
////////////////////////////////
void CPSZoneDisc : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector * posBefore , const NLMISC : : CVector * posAfter )
void CPSZoneDisc : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector Packed * posBefore , const NLMISC : : CVector Packed * posAfter )
{
{
NL_PS_FUNC ( CPSZoneDisc_computeCollisions )
NL_PS_FUNC ( CPSZoneDisc_computeCollisions )
MINI_TIMER ( PSStatsZoneDisc )
MINI_TIMER ( PSStatsZoneDisc )
@ -477,9 +477,9 @@ void CPSZoneDisc::computeCollisions(CPSLocated &target, uint firstInstanceIndex,
const float epsilon = 0.5f * PSCollideEpsilon ;
const float epsilon = 0.5f * PSCollideEpsilon ;
// deals with each particle
// deals with each particle
const NLMISC : : CVector * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector Packed * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector * itPosAfter = posAfter + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosAfter = posAfter + firstInstanceIndex ;
while ( itPosBefore ! = itPosBeforeEnd )
while ( itPosBefore ! = itPosBeforeEnd )
{
{
float posSide = p * * itPosBefore ;
float posSide = p * * itPosBefore ;
@ -503,7 +503,7 @@ void CPSZoneDisc::computeCollisions(CPSLocated &target, uint firstInstanceIndex,
hitRadius2 = ( ci . NewPos - center ) * ( ci . NewPos - center ) ;
hitRadius2 = ( ci . NewPos - center ) * ( ci . NewPos - center ) ;
if ( hitRadius2 < radiusIt - > R2 ) // check collision against disc
if ( hitRadius2 < radiusIt - > R2 ) // check collision against disc
{
{
const CVector & speed = target . getSpeed ( ) [ ( uint32 ) ( itPosBefore - posBefore ) ] ;
const CVector speed = target . getSpeed ( ) [ ( uint32 ) ( itPosBefore - posBefore ) ] ;
ci . NewSpeed = _BounceFactor * ( speed - 2.0f * ( speed * p . getNormal ( ) ) * p . getNormal ( ) ) ;
ci . NewSpeed = _BounceFactor * ( speed - 2.0f * ( speed * p . getNormal ( ) ) * p . getNormal ( ) ) ;
ci . CollisionZone = this ;
ci . CollisionZone = this ;
CPSLocated : : _Collisions [ itPosBefore - posBefore ] . update ( ci ) ;
CPSLocated : : _Collisions [ itPosBefore - posBefore ] . update ( ci ) ;
@ -847,7 +847,7 @@ void CPSZoneCylinder::performMotion(TAnimationTime ellapsedTime)
*/
*/
void CPSZoneCylinder : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector * posBefore , const NLMISC : : CVector * posAfter )
void CPSZoneCylinder : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector Packed * posBefore , const NLMISC : : CVector Packed * posAfter )
{
{
NL_PS_FUNC ( CPSZoneCylinder_computeCollisions )
NL_PS_FUNC ( CPSZoneCylinder_computeCollisions )
MINI_TIMER ( PSStatsZoneCylinder )
MINI_TIMER ( PSStatsZoneCylinder )
@ -873,9 +873,9 @@ void CPSZoneCylinder::computeCollisions(CPSLocated &target, uint firstInstanceIn
CVector destProjectedPos , destTPos ;
CVector destProjectedPos , destTPos ;
// deals with each particle
// deals with each particle
// deals with each particle
// deals with each particle
const NLMISC : : CVector * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector Packed * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector * itPosAfter = posAfter + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosAfter = posAfter + firstInstanceIndex ;
while ( itPosBefore ! = itPosBeforeEnd )
while ( itPosBefore ! = itPosBeforeEnd )
{
{
const CVector & pos = * itPosBefore ;
const CVector & pos = * itPosBefore ;
@ -1123,7 +1123,7 @@ void CPSZoneCylinder::deleteElement(uint32 index)
// implementation of CPSZoneRectangle //
// implementation of CPSZoneRectangle //
//////////////////////////////////////////////
//////////////////////////////////////////////
void CPSZoneRectangle : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector * posBefore , const NLMISC : : CVector * posAfter )
void CPSZoneRectangle : : computeCollisions ( CPSLocated & target , uint firstInstanceIndex , const NLMISC : : CVector Packed * posBefore , const NLMISC : : CVector Packed * posAfter )
{
{
NL_PS_FUNC ( CPSZoneRectangle_computeCollisions )
NL_PS_FUNC ( CPSZoneRectangle_computeCollisions )
MINI_TIMER ( PSStatsZoneRectangle )
MINI_TIMER ( PSStatsZoneRectangle )
@ -1149,9 +1149,9 @@ void CPSZoneRectangle::computeCollisions(CPSLocated &target, uint firstInstanceI
p . make ( X ^ Y , center ) ;
p . make ( X ^ Y , center ) ;
// deals with each particle
// deals with each particle
const float epsilon = 0.5f * PSCollideEpsilon ;
const float epsilon = 0.5f * PSCollideEpsilon ;
const NLMISC : : CVector * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosBefore = posBefore + firstInstanceIndex ;
const NLMISC : : CVector * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector Packed * itPosBeforeEnd = posBefore + target . getSize ( ) ;
const NLMISC : : CVector * itPosAfter = posAfter + firstInstanceIndex ;
const NLMISC : : CVector Packed * itPosAfter = posAfter + firstInstanceIndex ;
while ( itPosBefore ! = itPosBeforeEnd )
while ( itPosBefore ! = itPosBeforeEnd )
{
{
float posSide = p * * itPosBefore ;
float posSide = p * * itPosBefore ;