Add rayman2 source files
This commit is contained in:
464
Rayman_X/cpa/tempgrp/PIC/Deplacer.c
Normal file
464
Rayman_X/cpa/tempgrp/PIC/Deplacer.c
Normal file
@@ -0,0 +1,464 @@
|
||||
//-------------------------------------------------------------
|
||||
// Gestion des deplacements en 3d a l'aide de la souris.
|
||||
// Olivier Didelot le 15 decembre 1995.
|
||||
// modification : Marc Villemain le 04/07/96 : adaptation ACP
|
||||
//-------------------------------------------------------------
|
||||
|
||||
#include "MTH.h"
|
||||
#include "Acp_base.h"
|
||||
#include "Cpa_std.h"
|
||||
#include "HDL.h"
|
||||
#include "POS.h"
|
||||
#include "GMT.h"
|
||||
#include "GEO.h"
|
||||
#include "COL.h"
|
||||
#include "GLI.h"
|
||||
#include "PIC.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ECRAN = 0 ,
|
||||
MAP
|
||||
} tdeTContrainte ;
|
||||
|
||||
|
||||
|
||||
#ifdef ACTIVE_EDITOR
|
||||
static tdeTContrainte sTypeContrainte = ECRAN;
|
||||
static GLI_tdst2DVertex stMouse2DPrec;
|
||||
static MTH3D_tdstVector stPointMobil;
|
||||
static GLI_tdstCamera *p_stCamPrec;
|
||||
static BOOL gOkPourDeplacement = FALSE ;
|
||||
static POS_tdstCompletePosition stMatrixPrec;
|
||||
static GLD_tdhDevice g_hDev;
|
||||
static GLD_tdhViewport g_hVp;
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Definition of the plan as a non define plan.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
void PIC_vCreatePlan ( PIC_tdstEqPlan *p_stPlan )
|
||||
{
|
||||
p_stPlan -> xA = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
p_stPlan -> xB = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
p_stPlan -> xC = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
p_stPlan -> xD = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Return true if the plan is undefine.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
BOOL PIC_cIsPlanNull ( PIC_tdstEqPlan *p_stPlan )
|
||||
{
|
||||
return ( (p_stPlan -> xA == GLI_M_FloatToValue ( 0.0 ) )
|
||||
&& (p_stPlan -> xB == GLI_M_FloatToValue ( 0.0 ) )
|
||||
&& (p_stPlan -> xC == GLI_M_FloatToValue ( 0.0 ) )
|
||||
&& (p_stPlan -> xD == GLI_M_FloatToValue ( 0.0 ) ) ) ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Definition of the plan thanks to his equation :
|
||||
// a.x+b.y+c.z+d=0
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
void PIC_vDefinePlanEquation ( PIC_tdstEqPlan *p_stPlan ,
|
||||
GLI_tdxValue xA ,
|
||||
GLI_tdxValue xB ,
|
||||
GLI_tdxValue xC ,
|
||||
GLI_tdxValue xD )
|
||||
{
|
||||
p_stPlan -> xA = xA ;
|
||||
p_stPlan -> xB = xB ;
|
||||
p_stPlan -> xC = xC ;
|
||||
p_stPlan -> xD = xD ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Definition of the plan by a normal and a point.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
void PIC_vDefinePlanByNormale ( PIC_tdstEqPlan *p_stPlan ,
|
||||
MTH3D_tdstVector *p_stNormal,
|
||||
MTH3D_tdstVector *p_stPoint )
|
||||
{
|
||||
p_stPlan -> xA = p_stNormal -> xX ;
|
||||
p_stPlan -> xB = p_stNormal -> xY ;
|
||||
p_stPlan -> xC = p_stNormal -> xZ ;
|
||||
p_stPlan -> xD = GLI_M_Neg ( GLI_M_Add ( GLI_M_Mul ( p_stPlan -> xA ,
|
||||
p_stPoint -> xX ) ,
|
||||
GLI_M_Add ( GLI_M_Mul ( p_stPlan -> xB ,
|
||||
p_stPoint -> xY ) ,
|
||||
GLI_M_Mul ( p_stPlan -> xC ,
|
||||
p_stPoint -> xZ ) ) ) ) ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Definition of the plan by 3 points.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
void PIC_vDefinePlanBy3Points ( PIC_tdstEqPlan *p_stPlan ,
|
||||
MTH3D_tdstVector *p_stA,
|
||||
MTH3D_tdstVector *p_stB,
|
||||
MTH3D_tdstVector *p_stC )
|
||||
{
|
||||
MTH3D_tdstVector stNormal ;
|
||||
|
||||
GEO_xComputeNormalWeightedBySurf ( &stNormal , p_stA , p_stB , p_stC ) ;
|
||||
PIC_vDefinePlanByNormale ( p_stPlan , &stNormal, p_stA ) ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Definition of the plan as a perpendicular to the Z axe (horizontal plan),
|
||||
// and passing through the point (0, 0, Zo).
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
void fn_vDefinePlanZConstant ( PIC_tdstEqPlan *p_stPlan ,
|
||||
GLI_tdxValue stZConstant )
|
||||
{
|
||||
p_stPlan -> xA = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
p_stPlan -> xB = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
p_stPlan -> xC = GLI_M_FloatToValue ( 1.0 ) ;
|
||||
p_stPlan -> xD = GLI_M_Neg ( stZConstant ) ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Definition of the plan as a perpendicular to the Y axe (vertical plan),
|
||||
// and passing through the point (0, Yo, 0).
|
||||
// Yo is a "long 1616".
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
void fn_vDefinePlanYConstant ( PIC_tdstEqPlan *p_stPlan ,
|
||||
GLI_tdxValue stYConstant )
|
||||
{
|
||||
p_stPlan -> xA = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
p_stPlan -> xB = GLI_M_FloatToValue ( 1.0 ) ;
|
||||
p_stPlan -> xC = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
p_stPlan -> xD = GLI_M_Neg ( stYConstant ) ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Definition of the plan as a perpendicular to the X axe (vertical plan),
|
||||
// and passing through the point (Xo, 0, 0).
|
||||
// Xo is a "long 1616".
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
void fn_vDefinePlanXConstant ( PIC_tdstEqPlan *p_stPlan ,
|
||||
GLI_tdxValue stXConstant )
|
||||
{
|
||||
p_stPlan -> xA = GLI_M_FloatToValue ( 1.0 ) ;
|
||||
p_stPlan -> xB = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
p_stPlan -> xC = GLI_M_FloatToValue ( 0.0 ) ;
|
||||
p_stPlan -> xD = GLI_M_Neg ( stXConstant ) ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Modify equation of a plan : the plan become parallel to himself but he
|
||||
// passes through a particular point.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
void fn_vRecalePlanPoint ( PIC_tdstEqPlan *p_stPlan ,
|
||||
MTH3D_tdstVector *p_stPoint )
|
||||
{
|
||||
// On ne recalcul que le parametre xD.
|
||||
p_stPlan -> xD = GLI_M_Neg ( GLI_M_Add ( GLI_M_Mul ( p_stPlan -> xA ,
|
||||
p_stPoint -> xX ) ,
|
||||
GLI_M_Add ( GLI_M_Mul ( p_stPlan -> xB ,
|
||||
p_stPoint -> xY ) ,
|
||||
GLI_M_Mul ( p_stPlan -> xC ,
|
||||
p_stPoint -> xZ ) ) ) ) ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Intersection between a plan and a line.
|
||||
// Input:
|
||||
// p_stA, p_stB --> The line.
|
||||
// Output:
|
||||
// p_stInter --> Intersection point.
|
||||
// Return TRUE if the Intersection exist, FALSE otherwise.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
BOOL PIC_bIntersectionPlanDroite ( PIC_tdstEqPlan *p_stPlan ,
|
||||
MTH3D_tdstVector *p_stA ,
|
||||
MTH3D_tdstVector *p_stB ,
|
||||
MTH3D_tdstVector *p_stInter )
|
||||
{
|
||||
GLI_tdxValue xReturnEqA , xReturnEqAB , xDivReturnEq ;
|
||||
MTH3D_tdstVector stAB ;
|
||||
|
||||
MTH3D_M_vSubVector ( &stAB, p_stB, p_stA ) ;
|
||||
|
||||
xReturnEqA = GLI_M_Add ( GLI_M_Mul ( p_stPlan -> xA ,
|
||||
p_stA -> xX ) ,
|
||||
GLI_M_Add ( GLI_M_Mul ( p_stPlan -> xB ,
|
||||
p_stA -> xY ) ,
|
||||
GLI_M_Add ( GLI_M_Mul ( p_stPlan -> xC ,
|
||||
p_stA -> xZ ) ,
|
||||
p_stPlan -> xD ) ) ) ;
|
||||
|
||||
xReturnEqAB = GLI_M_Add ( GLI_M_Mul ( p_stPlan -> xA ,
|
||||
stAB . xX ) ,
|
||||
GLI_M_Add ( GLI_M_Mul ( p_stPlan -> xB ,
|
||||
stAB . xY ) ,
|
||||
GLI_M_Mul ( p_stPlan -> xC ,
|
||||
stAB . xZ ) ) ) ;
|
||||
|
||||
if ( xReturnEqAB == GLI_M_FloatToValue ( 0.0 ) ) /* le vecteur AB est dans le plan */
|
||||
return FALSE ;
|
||||
|
||||
xDivReturnEq = GLI_M_Neg ( GLI_M_Div ( xReturnEqA , xReturnEqAB ) ) ;
|
||||
|
||||
p_stInter->xX = GLI_M_Add ( p_stA -> xX ,
|
||||
GLI_M_Mul( xDivReturnEq ,
|
||||
GLI_M_Sub ( p_stB -> xX ,
|
||||
p_stA -> xX ) ) ) ;
|
||||
p_stInter->xY = GLI_M_Add ( p_stA -> xY ,
|
||||
GLI_M_Mul( xDivReturnEq ,
|
||||
GLI_M_Sub ( p_stB -> xY ,
|
||||
p_stA -> xY ) ) ) ;
|
||||
p_stInter->xZ = GLI_M_Add ( p_stA -> xZ ,
|
||||
GLI_M_Mul( xDivReturnEq ,
|
||||
GLI_M_Sub ( p_stB -> xZ ,
|
||||
p_stA -> xZ ) ) ) ;
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Defini le plan de contrainte comme etant perpendiculaire a l'axe Z de la camera,
|
||||
// et passant par le point P.
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
void fn_vDefScreenConstraint ( PIC_tdstEqPlan *p_stPlan ,
|
||||
MTH3D_tdstVector *p_stPoint )
|
||||
{
|
||||
MTH3D_tdstVector stAxeCameraZ, stTemp;
|
||||
POS_tdstCompletePosition stMatrix, stInvMatrix;
|
||||
|
||||
POS_fn_vSetIdentityMatrix(&stMatrix);
|
||||
POS_fn_vSetIdentityMatrix(&stInvMatrix);
|
||||
GLI_xGetCameraMatrix ( p_stCamPrec , &stMatrix );
|
||||
POS_fn_vInvertIsoMatrix( &stInvMatrix , &stMatrix );
|
||||
stTemp . xX = GLI_M_FloatToValue ( 0.0 );
|
||||
stTemp . xY = GLI_M_FloatToValue ( 0.0 );
|
||||
stTemp . xZ = GLI_M_FloatToValue ( 1.0 );
|
||||
POS_fn_vMulMatrixVertex( &stAxeCameraZ , &stInvMatrix , &stTemp );
|
||||
POS_fn_vGetTranslationVector( &stInvMatrix , &stTemp );
|
||||
MTH3D_M_vSubVector( &stAxeCameraZ, &stAxeCameraZ, &stTemp);
|
||||
|
||||
PIC_vDefinePlanByNormale ( p_stPlan , &stAxeCameraZ , p_stPoint );
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Definition of the constraint plan, thanks to CONTRAINTE and point wich is
|
||||
// defined by the editor (p_stPoint).
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
void fn_vDefPlanConstraint ( PIC_tdstEqPlan *p_stPlan ,
|
||||
MTH3D_tdstVector *p_stPoint )
|
||||
{
|
||||
switch (sTypeContrainte)
|
||||
{
|
||||
case MAP :
|
||||
break;
|
||||
|
||||
case ECRAN :
|
||||
fn_vDefScreenConstraint ( p_stPlan , p_stPoint ) ;
|
||||
break ;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Calculate the mouse 3d position. The calculated point is the intersection
|
||||
// between line [camera position; 3d Mouse (on screen)] and constraint plan.
|
||||
// Return 1 if the intersection exist, 0 otherwise.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
BOOL fn_bCalculateMouse3DConstraint
|
||||
(
|
||||
PIC_tdstEqPlan *p_stPlan,
|
||||
GLI_tdst2DVertex *p_stPoint2D,
|
||||
MTH3D_tdstVector *p_stPoint3D
|
||||
)
|
||||
{
|
||||
MTH3D_tdstVector stPosMouse, stPosCam;
|
||||
POS_tdstCompletePosition stMatrix, stInvMatrix;
|
||||
|
||||
PIC_vMouse3DScreen ( g_hDev, g_hVp, p_stPoint2D , &stPosMouse);
|
||||
|
||||
if( p_stCamPrec->lCameraMode == GLI_C_lPersCamWithDistorsion
|
||||
|| p_stCamPrec->lCameraMode == GLI_C_lPersCamWithoutDistorsion )
|
||||
{
|
||||
POS_fn_vSetIdentityMatrix(&stMatrix); //AR980624 A position MUST be initialised !
|
||||
POS_fn_vSetIdentityMatrix(&stInvMatrix);
|
||||
GLI_xGetCameraMatrix ( p_stCamPrec, &stMatrix ) ;
|
||||
POS_fn_vInvertIsoMatrix( &stInvMatrix , &stMatrix );
|
||||
POS_fn_vGetTranslationVector( &stInvMatrix , &stPosCam ) ;
|
||||
}
|
||||
else if( p_stCamPrec->lCameraMode == GLI_C_lIsoCamWithDistorsion
|
||||
|| p_stCamPrec->lCameraMode == GLI_C_lIsoCamWithoutDistorsion )
|
||||
{
|
||||
MTH3D_tdstVector stAxeCameraZ, stTemp;
|
||||
|
||||
GLI_xGetCameraMatrix ( p_stCamPrec , &stMatrix );
|
||||
POS_fn_vInvertIsoMatrix( &stInvMatrix , &stMatrix );
|
||||
stTemp . xX = GLI_M_FloatToValue ( 0.0 );
|
||||
stTemp . xY = GLI_M_FloatToValue ( 0.0 );
|
||||
stTemp . xZ = GLI_M_FloatToValue ( 1.0 );
|
||||
POS_fn_vMulMatrixVertex( &stAxeCameraZ , &stInvMatrix , &stTemp );
|
||||
|
||||
MTH3D_M_vSubVector( &stPosCam, &stPosMouse, &stAxeCameraZ);
|
||||
}
|
||||
|
||||
return PIC_bIntersectionPlanDroite ( p_stPlan , &stPosCam , &stPosMouse , p_stPoint3D ) ;
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Calculate the mouse 3d position. The calculated point is on the map.
|
||||
// Return 1 if this position exist, 0 otherwise.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
BOOL fn_bCalculateMouse3DMap( GLI_tdst2DVertex *p_stPoint2D ,
|
||||
MTH3D_tdstVector *p_stPoint3D )
|
||||
{
|
||||
return FALSE ;
|
||||
}
|
||||
#endif
|
||||
|
||||
//***************************************************************************
|
||||
// Calculate the mouse 3d position.
|
||||
// Return 1 if this position exist, 0 otherwise.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
BOOL fn_bCalculateMouse3D ( PIC_tdstEqPlan *p_stPlan ,
|
||||
GLI_tdst2DVertex *p_stPoint2D ,
|
||||
MTH3D_tdstVector *p_stPoint3D )
|
||||
{
|
||||
switch (sTypeContrainte)
|
||||
{
|
||||
case MAP :
|
||||
return fn_bCalculateMouse3DMap ( p_stPoint2D , p_stPoint3D ) ;
|
||||
|
||||
case ECRAN :
|
||||
default :
|
||||
return fn_bCalculateMouse3DConstraint ( p_stPlan , p_stPoint2D , p_stPoint3D ) ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//***************************************************************************
|
||||
// Calculate the moving vector of 3d Mouse. This moving is constraint by the
|
||||
// plan PlanC in the constraint mode else the moving is in the screen plan.
|
||||
//***************************************************************************
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
BOOL fn_bCalculateVectorMouse3D ( PIC_tdstEqPlan *p_stPlan ,
|
||||
GLI_tdst2DVertex *p_stMouse2D ,
|
||||
MTH3D_tdstVector *p_stVect )
|
||||
{
|
||||
MTH3D_tdstVector stMouse3D , stMouse3DPrec ;
|
||||
BOOL bTest1, bTest2 ;
|
||||
|
||||
bTest1 = fn_bCalculateMouse3D ( p_stPlan , &stMouse2DPrec , &stMouse3DPrec) ;
|
||||
bTest2 = fn_bCalculateMouse3D ( p_stPlan , p_stMouse2D , &stMouse3D ) ;
|
||||
|
||||
if (bTest1 && bTest2)
|
||||
{
|
||||
MTH3D_M_vSubVector ( p_stVect ,&stMouse3D, &stMouse3DPrec ) ;
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
else
|
||||
return FALSE ;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
// Calculate the moving vector of 3d Mouse, if this is possible.
|
||||
// Input :
|
||||
// p_stMouse2D --> Mouse coordinates.
|
||||
// Output :
|
||||
// p_stVect --> Moving vector.
|
||||
// Return :
|
||||
// FALSE if no vecteur, else TRUE.
|
||||
//***************************************************************************
|
||||
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
BOOL PIC_bGetVecteurDeplacement ( GLI_tdst2DVertex *p_stMouse2D ,
|
||||
MTH3D_tdstVector *p_stVect )
|
||||
{
|
||||
PIC_tdstEqPlan stPlan;
|
||||
MTH3D_tdstVector stVectCam;
|
||||
POS_tdstCompletePosition stMatrix, stChangeMatrix, stMatTemp;
|
||||
|
||||
if( !gOkPourDeplacement )
|
||||
return FALSE ;
|
||||
|
||||
GLI_xGetCameraMatrix ( p_stCamPrec , &stMatTemp );
|
||||
POS_fn_vInvertIsoMatrix( &stMatrix , &stMatTemp );
|
||||
|
||||
POS_fn_vMulMatrixMatrix( &stChangeMatrix, &stMatrix, &stMatrixPrec);
|
||||
POS_fn_vMulMatrixVertex( &stVectCam, &stChangeMatrix, &stPointMobil);
|
||||
|
||||
MTH3D_M_vSubVector(&stVectCam, &stVectCam, &stPointMobil);
|
||||
|
||||
// Calcul du deplacement de l'objet d<> a la souris
|
||||
fn_vDefPlanConstraint( &stPlan , &stPointMobil ) ;
|
||||
if (! fn_bCalculateVectorMouse3D ( &stPlan , p_stMouse2D, p_stVect ) )
|
||||
return FALSE ;
|
||||
|
||||
// On tient compte du deplacement de la camera
|
||||
MTH3D_M_vAddVector(p_stVect, p_stVect, &stVectCam);
|
||||
|
||||
// Pour le deplacement suivant
|
||||
stMatrixPrec = stMatTemp;
|
||||
stMouse2DPrec = *p_stMouse2D ;
|
||||
|
||||
// mise a jour du point mobil
|
||||
MTH3D_M_vAddVector( &stPointMobil, &stPointMobil, p_stVect ) ;
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ACTIVE_EDITOR
|
||||
void PIC_vInitDeplacement ( GLD_tdhDevice hDev ,
|
||||
GLD_tdhViewport hVp ,
|
||||
GLI_tdst2DVertex *p_stMouse2D ,
|
||||
MTH3D_tdstVector *p_stPointMobil)
|
||||
{
|
||||
GLI_tdstSpecificAttributesFor3D *p_stSpecAttrib3D;
|
||||
GLD_tdstViewportAttributes stViewAttrib;
|
||||
|
||||
g_hDev = hDev;
|
||||
g_hVp = hVp;
|
||||
|
||||
if ( !GLD_bGetViewportAttributes( hDev, hVp, &stViewAttrib ) )
|
||||
return;
|
||||
p_stSpecAttrib3D
|
||||
= (GLI_tdstSpecificAttributesFor3D *)stViewAttrib.p_vSpecificToXD;
|
||||
p_stCamPrec = p_stSpecAttrib3D->p_stCam;
|
||||
|
||||
stMouse2DPrec = *p_stMouse2D ;
|
||||
gOkPourDeplacement = TRUE ;
|
||||
stPointMobil = *p_stPointMobil;
|
||||
|
||||
GLI_xGetCameraMatrix( p_stCamPrec , &stMatrixPrec );
|
||||
}
|
||||
#endif
|
||||
#ifdef ACTIVE_EDITOR
|
||||
void PIC_vEndDeplacement ( void )
|
||||
{
|
||||
gOkPourDeplacement = FALSE ;
|
||||
}
|
||||
#endif
|
143
Rayman_X/cpa/tempgrp/PIC/Pic.dsp
Normal file
143
Rayman_X/cpa/tempgrp/PIC/Pic.dsp
Normal file
@@ -0,0 +1,143 @@
|
||||
# Microsoft Developer Studio Project File - Name="PIC" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=PIC - Win32 Debug with Editors
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Pic.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Pic.mak" CFG="PIC - Win32 Debug with Editors"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "PIC - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "PIC - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "PIC - Win32 Retail" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "PIC - Win32 Debug with Editors" (based on\
|
||||
"Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""$/cpa/tempgrp/PIC", BYDAAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
|
||||
!IF "$(CFG)" == "PIC - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "x:\cpa\lib"
|
||||
# PROP Intermediate_Dir "Tmp\Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /W3 /GX /O2 /I "t:\glide\win32\include" /I "t:\dxsdk\sdk\inc" /I "x:\cpa\public" /I ".\\" /D "NDEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "PC" /FD /c
|
||||
# SUBTRACT CPP /Fr /YX
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"X:\CPA\LIB\PICP5_VR.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "PIC - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "x:\cpa\lib"
|
||||
# PROP Intermediate_Dir "tmp\Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /MD /W3 /GX /Z7 /Od /I "t:\glide\win32\include" /I "t:\dxsdk\sdk\inc" /I "x:\cpa\public" /I ".\\" /D "_DEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "MTH_CHECK" /D "CPA_WANTS_EXPORT" /D "PC" /FD /c
|
||||
# SUBTRACT CPP /Fr /YX
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"X:\CPA\LIB\PICP5_VD.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "PIC - Win32 Retail"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "PIC___Wi"
|
||||
# PROP BASE Intermediate_Dir "PIC___Wi"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "x:\cpa\lib"
|
||||
# PROP Intermediate_Dir "tmp\retail"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /G5 /W3 /GX /O2 /I "t:\glide\win32\include" /I "t:\dxsdk\sdk\inc" /I "x:\cpa\public" /I ".\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PC" /FD /c
|
||||
# SUBTRACT BASE CPP /Fr /YX
|
||||
# ADD CPP /nologo /G5 /W3 /GX /O2 /I "t:\glide\win32\include" /I "t:\dxsdk\sdk\inc" /I "x:\cpa\public" /I ".\\" /D "NDEBUG" /D "VISUAL" /D "WIN32" /D "PC" /D "RETAIL" /FD /c
|
||||
# SUBTRACT CPP /Fr /YX
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo /out:"X:\CPA\LIB\PICP5_VR.lib"
|
||||
# ADD LIB32 /nologo /out:"X:\CPA\LIB\PICP5_Vf.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "PIC - Win32 Debug with Editors"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "PIC___Wi"
|
||||
# PROP BASE Intermediate_Dir "PIC___Wi"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "x:\cpa\lib"
|
||||
# PROP Intermediate_Dir "tmp\DebugEd"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /G5 /MD /W3 /GX /Z7 /Od /I "t:\glide\win32\include" /I "t:\dxsdk\sdk\inc" /I "x:\cpa\public" /I ".\\" /D "_DEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "MTH_CHECK" /D "CPA_WANTS_EXPORT" /D "PC" /FD /c
|
||||
# SUBTRACT BASE CPP /Fr /YX
|
||||
# ADD CPP /nologo /G5 /MD /W3 /GX /Z7 /Od /I "t:\glide\win32\include" /I "t:\dxsdk\sdk\inc" /I "x:\cpa\public" /I ".\\" /D "_DEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "MTH_CHECK" /D "CPA_WANTS_EXPORT" /D "ACTIVE_EDITOR" /D "PC" /FD /c
|
||||
# SUBTRACT CPP /Fr /YX
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo /out:"X:\CPA\LIB\PICP5_VD.lib"
|
||||
# ADD LIB32 /nologo /out:"X:\CPA\LIB\PICP5EVD.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "PIC - Win32 Release"
|
||||
# Name "PIC - Win32 Debug"
|
||||
# Name "PIC - Win32 Retail"
|
||||
# Name "PIC - Win32 Debug with Editors"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Deplacer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pic.mak
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Picking.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
292
Rayman_X/cpa/tempgrp/PIC/Pic.vcproj
Normal file
292
Rayman_X/cpa/tempgrp/PIC/Pic.vcproj
Normal file
@@ -0,0 +1,292 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="PIC"
|
||||
ProjectGUID="{0AAC9A29-EB6F-43E6-B13C-E63CD458767A}"
|
||||
SccProjectName=""$/cpa/tempgrp/PIC", BYDAAAAA"
|
||||
SccAuxPath=""
|
||||
SccLocalPath="."
|
||||
SccProvider="MSSCCI:NXN alienbrain">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="x:\cpa\lib"
|
||||
IntermediateDirectory=".\Tmp\Release"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OptimizeForProcessor="1"
|
||||
AdditionalIncludeDirectories="t:\glide\win32\include,t:\dxsdk\sdk\inc,x:\cpa\public,.\"
|
||||
PreprocessorDefinitions="NDEBUG;VISUAL;WIN32;USE_PROFILER;PC"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
PrecompiledHeaderFile=".\Tmp\Release/Pic.pch"
|
||||
AssemblerListingLocation=".\Tmp\Release/"
|
||||
ObjectFile=".\Tmp\Release/"
|
||||
ProgramDataBaseFileName=".\Tmp\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="X:\CPA\LIB\PICP5_VR.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="x:\cpa\libd"
|
||||
IntermediateDirectory=".\tmp\Debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
OptimizeForProcessor="1"
|
||||
AdditionalIncludeDirectories="t:\glide\win32\include,t:\dxsdk\sdk\inc,x:\cpa\public,.\"
|
||||
PreprocessorDefinitions="_DEBUG;VISUAL;WIN32;USE_PROFILER;MTH_CHECK;CPA_WANTS_EXPORT;PC"
|
||||
RuntimeLibrary="2"
|
||||
PrecompiledHeaderFile=".\tmp\Debug/Pic.pch"
|
||||
AssemblerListingLocation=".\tmp\Debug/"
|
||||
ObjectFile=".\tmp\Debug/"
|
||||
ProgramDataBaseFileName=".\tmp\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="X:\CPA\LIBd\PICP5_VD.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Retail|Win32"
|
||||
OutputDirectory="x:\cpa\lib"
|
||||
IntermediateDirectory=".\tmp\retail"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OptimizeForProcessor="1"
|
||||
AdditionalIncludeDirectories="t:\glide\win32\include,t:\dxsdk\sdk\inc,x:\cpa\public,.\"
|
||||
PreprocessorDefinitions="NDEBUG;VISUAL;WIN32;PC;RETAIL"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
PrecompiledHeaderFile=".\tmp\retail/Pic.pch"
|
||||
AssemblerListingLocation=".\tmp\retail/"
|
||||
ObjectFile=".\tmp\retail/"
|
||||
ProgramDataBaseFileName=".\tmp\retail/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="X:\CPA\LIB\PICP5_Vf.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug with Editors|Win32"
|
||||
OutputDirectory="x:\cpa\libD"
|
||||
IntermediateDirectory=".\tmp\DebugEd"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
OptimizeForProcessor="1"
|
||||
AdditionalIncludeDirectories="t:\glide\win32\include,t:\dxsdk\sdk\inc,x:\cpa\public,.\"
|
||||
PreprocessorDefinitions="_DEBUG;VISUAL;WIN32;USE_PROFILER;MTH_CHECK;CPA_WANTS_EXPORT;ACTIVE_EDITOR;PC"
|
||||
RuntimeLibrary="3"
|
||||
PrecompiledHeaderFile=".\tmp\DebugEd/Pic.pch"
|
||||
AssemblerListingLocation=".\tmp\DebugEd/"
|
||||
ObjectFile=".\tmp\DebugEd/"
|
||||
ProgramDataBaseFileName=".\tmp\DebugEd/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="X:\CPA\LIBD\PICP5EVD.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<File
|
||||
RelativePath="Deplacer.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Retail|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Pic.mak">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Picking.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Retail|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug with Editors|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
347
Rayman_X/cpa/tempgrp/PIC/Picking.c
Normal file
347
Rayman_X/cpa/tempgrp/PIC/Picking.c
Normal file
@@ -0,0 +1,347 @@
|
||||
#include "MTH.h"
|
||||
#include "Acp_base.h"
|
||||
#include "Cpa_std.h"
|
||||
#include "HDL.h"
|
||||
#include "POS.h"
|
||||
#include "GMT.h"
|
||||
#include "GEO.h"
|
||||
#include "COL.h"
|
||||
#include "GLI.h"
|
||||
#include "PIC.h"
|
||||
|
||||
/*#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
M_LoadExternGlobalDeclaration();
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif*/
|
||||
|
||||
#ifdef ACTIVE_EDITOR
|
||||
|
||||
static MTH2D_tdstVector g_stSouris2D;
|
||||
static GLD_tdhDevice g_hDev = 0;
|
||||
static GLD_tdhViewport g_hVp = 0;
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifdef PC
|
||||
extern float gs_xConstantFor3dfxBugFloat;
|
||||
#endif
|
||||
*/
|
||||
|
||||
/*************************************************************************************/
|
||||
/* Calcul de la position 3d de la souris. Le point 3d calcule appartient a l'ecran. */
|
||||
/*************************************************************************************/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
void PIC_vMouse3DScreen ( GLD_tdhDevice hDev,
|
||||
GLD_tdhViewport hVp,
|
||||
GLI_tdst2DVertex *p_stInput ,
|
||||
MTH3D_tdstVector *p_stOutput )
|
||||
{
|
||||
GLI_tdstSpecificAttributesFor3D *p_stSpecAttrib3D;
|
||||
GLD_tdstViewportAttributes stViewAttrib;
|
||||
GLD_tdstDeviceAttributes stDevAttrib;
|
||||
MTH3D_tdstVector stTemp ;
|
||||
POS_tdstCompletePosition stMatrix, stInvMatrix ;
|
||||
GLI_tdstCamera *p_stCam;
|
||||
GLI_tdst2DVertex stTrans;
|
||||
MTH_tdxReal xScreen;
|
||||
|
||||
if ( !GLD_bGetViewportAttributes( hDev, hVp, &stViewAttrib ) ) return;
|
||||
if ( !GLD_bGetDeviceAttributes( hDev, &stDevAttrib ) ) return;
|
||||
p_stSpecAttrib3D = (GLI_tdstSpecificAttributesFor3D *)stViewAttrib.p_vSpecificToXD;
|
||||
p_stCam = p_stSpecAttrib3D->p_stCam;
|
||||
|
||||
switch(p_stCam->lCameraMode)
|
||||
{
|
||||
case GLI_C_lIsoCamWithDistorsion :
|
||||
case GLI_C_lIsoCamWithoutDistorsion :
|
||||
xScreen = MTH_M_xFloatToReal(0.1f);
|
||||
break;
|
||||
case GLI_C_lPersCamWithDistorsion :
|
||||
case GLI_C_lPersCamWithoutDistorsion :
|
||||
xScreen = p_stCam->xScreen;
|
||||
break ;
|
||||
default:
|
||||
p_stOutput->xX = p_stOutput->xY = p_stOutput->xZ = MTH_M_xFloatToReal(0.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
/* on se ramene en unite du monde */
|
||||
/*
|
||||
if(GLI_lWhatIsGLI() == GLI_C_VersionGlide)
|
||||
{
|
||||
#ifdef PC
|
||||
stTrans.xX = p_stCam->stTrans.xX - gs_xConstantFor3dfxBugFloat;
|
||||
stTrans.xY = p_stCam->stTrans.xY - gs_xConstantFor3dfxBugFloat;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
stTrans.xX = p_stCam->stTrans.xX;
|
||||
stTrans.xY = p_stCam->stTrans.xY;
|
||||
}
|
||||
*/
|
||||
stTrans.xX = p_stCam->stTrans.xX;
|
||||
stTrans.xY = p_stCam->stTrans.xY;
|
||||
|
||||
stTemp.xX = MTH_M_xDiv( MTH_M_xSub( MTH_M_xLongToReal(p_stInput->xX), MTH_M_xLongToReal(stTrans.xX)),
|
||||
MTH_M_xFloatToReal(p_stCam->stScale.xX));
|
||||
stTemp.xY = MTH_M_xDiv( MTH_M_xSub( MTH_M_xLongToReal(p_stInput->xY), MTH_M_xLongToReal(stTrans.xY) ),
|
||||
MTH_M_xFloatToReal(p_stCam->stScale.xY) ) ;
|
||||
stTemp.xZ = xScreen;
|
||||
|
||||
/* Convertion dans le repere du monde */
|
||||
GLI_xGetCameraMatrix ( p_stCam , &stMatrix );
|
||||
POS_fn_vInvertMatrix( &stInvMatrix , &stMatrix );
|
||||
POS_fn_vMulMatrixVertex( p_stOutput , &stInvMatrix , &stTemp );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
void PIC_vGetPosCamAndMouse(GLD_tdhDevice hDev,
|
||||
GLD_tdhViewport hVp,
|
||||
GLI_tdst2DVertex *p_stSouris2D,
|
||||
MTH3D_tdstVector *p_stSouris3D,
|
||||
MTH3D_tdstVector *p_stCamera)
|
||||
{
|
||||
GLD_tdstViewportAttributes stViewAttrib;
|
||||
GLI_tdstSpecificAttributesFor3D *p_stSpecAttrib3D;
|
||||
GLI_tdstCamera *p_stCam;
|
||||
POS_tdstCompletePosition stMatrix, stInvMatrix;
|
||||
MTH3D_tdstVector stAxe, stAxeZ;
|
||||
MTH3D_tdstVector stSouris3D, stTmp;
|
||||
MTH3D_tdstVector stTrans;
|
||||
|
||||
// recuperation de la camera
|
||||
if(!GLD_bGetViewportAttributes(hDev, hVp, &stViewAttrib)) return;
|
||||
p_stSpecAttrib3D = (GLI_tdstSpecificAttributesFor3D *)stViewAttrib.p_vSpecificToXD;
|
||||
p_stCam = p_stSpecAttrib3D->p_stCam;
|
||||
|
||||
PIC_vMouse3DScreen ( hDev, hVp, p_stSouris2D , &stSouris3D );
|
||||
|
||||
// get camera position
|
||||
if( p_stCam->lCameraMode == GLI_C_lPersCamWithDistorsion
|
||||
|| p_stCam->lCameraMode == GLI_C_lPersCamWithoutDistorsion )
|
||||
{
|
||||
GLI_xGetCameraMatrix ( p_stCam, &stMatrix );
|
||||
POS_fn_vInvertMatrix( &stInvMatrix , &stMatrix );
|
||||
POS_fn_vGetTranslationVector( &stInvMatrix , p_stCamera );
|
||||
}
|
||||
else if( p_stCam->lCameraMode == GLI_C_lIsoCamWithDistorsion
|
||||
|| p_stCam->lCameraMode == GLI_C_lIsoCamWithoutDistorsion )
|
||||
{
|
||||
// calcul de l'axe Z de la camera
|
||||
GLI_xGetCameraMatrix ( p_stCam, &stMatrix );
|
||||
POS_fn_vInvertMatrix( &stInvMatrix , &stMatrix );
|
||||
stAxe.xX = MTH_M_xFloatToReal(0.0);
|
||||
stAxe.xY = MTH_M_xFloatToReal(0.0);
|
||||
stAxe.xZ = MTH_M_xFloatToReal(1.0);
|
||||
POS_fn_vMulMatrixVertex(&stTmp, &stInvMatrix, &stAxe);
|
||||
POS_fn_vGetTranslationVector( &stInvMatrix,&stTrans);
|
||||
MTH3D_M_vSubVector(&stAxeZ, &stTmp, &stTrans);
|
||||
MTH3D_M_vSubVector(p_stCamera, &stSouris3D, &stAxeZ);
|
||||
}
|
||||
|
||||
if(p_stSouris3D != NULL)
|
||||
{
|
||||
*p_stSouris3D = stSouris3D;
|
||||
}
|
||||
|
||||
g_stSouris2D.xX = p_stSouris2D->xX;
|
||||
g_stSouris2D.xY = p_stSouris2D->xY;
|
||||
g_hDev = hDev;
|
||||
g_hVp = hVp;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ACTIVE_EDITOR
|
||||
// active editor only
|
||||
BOOL PIC_xIntersectSemiAxeWithSphereBox(MTH3D_tdstVector *p_stVertexA,
|
||||
MTH3D_tdstVector *p_stVectAB,
|
||||
GLI_tdstSphere *p_stSphere )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// used
|
||||
|
||||
BOOL PIC_bIntersectSegmentWithGeometricObject(MTH3D_tdstVector *p_stCameraPos,
|
||||
MTH3D_tdstVector *p_stVertex12,
|
||||
GEO_tdstGeometricObject *p_stObject ,
|
||||
PIC_tdstPickedObject *p_stPickedObject)
|
||||
{
|
||||
// GLI_tdstSphere stSphere;
|
||||
ACP_tdxIndex xNbElements;
|
||||
BOOL bTest,bReturn = FALSE;
|
||||
MTH3D_tdstVector stSouris3D;
|
||||
|
||||
MTH3D_M_vAddVector(&stSouris3D, p_stCameraPos, p_stVertex12);
|
||||
|
||||
bTest = INT_fn_bIntersectSegmentWithFaceOfGeometricObject(p_stCameraPos,
|
||||
&stSouris3D,
|
||||
p_stVertex12,
|
||||
p_stObject,
|
||||
PIC_C_DepthPickingElements,
|
||||
&xNbElements,
|
||||
p_stPickedObject->aDEF_stDataOfElement);
|
||||
|
||||
if( bTest )
|
||||
{
|
||||
MTH3D_tdstVector stTemp;
|
||||
ACP_tdxIndex i;
|
||||
|
||||
POS_fn_vMulMatrixVertex(&stTemp, g_p_stCurrentMatrix, p_stCameraPos);
|
||||
|
||||
for(i=0; i<xNbElements; i++)
|
||||
{
|
||||
POS_fn_vMulMatrixVertex(&(p_stPickedObject->aDEF_stDataOfElement[i].stHit),
|
||||
g_p_stCurrentMatrix,
|
||||
&(p_stPickedObject->aDEF_stDataOfElement[i].stHit));
|
||||
|
||||
p_stPickedObject->aDEF_stDataOfElement[i].xDistance =
|
||||
MTH3D_M_xVectorGap(&stTemp, &(p_stPickedObject->aDEF_stDataOfElement[i].stHit));
|
||||
}
|
||||
p_stPickedObject->xNbElements = xNbElements;
|
||||
p_stPickedObject->xModePicking = PIC_C_ModePickingFace;
|
||||
|
||||
bReturn = TRUE;
|
||||
}
|
||||
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
|
||||
#if defined(ACTIVE_EDITOR)
|
||||
// active editor only
|
||||
BOOL PIC_bIntersectSemiAxeWithGeometricObject(PIC_tdeModePicking xModePicking,
|
||||
MTH3D_tdstVector *p_stCameraPos,
|
||||
MTH3D_tdstVector *p_stVertex12,
|
||||
GEO_tdstGeometricObject *p_stObject ,
|
||||
PIC_tdstPickedObject *p_stPickedObject)
|
||||
{
|
||||
GLI_tdstSphere stSphere;
|
||||
ACP_tdxIndex xNbElements;
|
||||
//XB980505
|
||||
// BOOL bTest,bReturn = FALSE;
|
||||
BOOL bTest=FALSE;
|
||||
BOOL bReturn = FALSE;
|
||||
//End XB
|
||||
MTH3D_tdstVector stSouris3D;
|
||||
GLI_tdst2DVertex stInput;
|
||||
MTH3D_tdstVector stOutput;
|
||||
POS_tdstCompletePosition stInvMatrix;
|
||||
|
||||
// stSphere = p_stObject->stAbsoluteSphereBox;
|
||||
|
||||
MTH3D_M_vAddVector(&stSouris3D, p_stCameraPos, p_stVertex12);
|
||||
|
||||
if(PIC_xIntersectSemiAxeWithSphereBox(p_stCameraPos, p_stVertex12, &stSphere) )
|
||||
{
|
||||
switch(xModePicking)
|
||||
{
|
||||
|
||||
case PIC_C_ModePickingFace:
|
||||
bTest = INT_fn_bIntersectSemiAxeWithFaceOfGeometricObject(p_stCameraPos,
|
||||
&stSouris3D,
|
||||
p_stVertex12,
|
||||
p_stObject,
|
||||
PIC_C_DepthPickingElements,
|
||||
&xNbElements,
|
||||
p_stPickedObject->aDEF_stDataOfElement);
|
||||
if(GLD_bIsDeviceHandleValid(g_hDev) && GLD_bIsViewportHandleValid(g_hVp))
|
||||
{
|
||||
stInput.xX = g_stSouris2D.xX;
|
||||
stInput.xY = g_stSouris2D.xY;
|
||||
PIC_vMouse3DScreen(g_hDev, g_hVp, &stInput, &stOutput);
|
||||
POS_fn_vInvertMatrix(&stInvMatrix , g_p_stCurrentMatrix);
|
||||
POS_fn_vMulMatrixVertex(&stOutput, &stInvMatrix, &stOutput);
|
||||
if( MTH3D_M_bEqualVector(&stOutput, &stSouris3D) )
|
||||
{
|
||||
GLD_tdstViewportAttributes stViewAttrib;
|
||||
|
||||
if ( !GLD_bGetViewportAttributes( g_hDev, g_hVp, &stViewAttrib ) ) return FALSE;
|
||||
bTest += GLI_lPickSprites ( &stViewAttrib,
|
||||
p_stObject,
|
||||
&g_stSouris2D,
|
||||
PIC_C_DepthPickingElements,
|
||||
&xNbElements,
|
||||
p_stPickedObject->aDEF_stDataOfElement,
|
||||
p_stCameraPos,
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case PIC_C_ModePickingEdge:
|
||||
bTest = INT_fn_bIntersectSemiAxeWithEdgeOfGeometricObject(p_stCameraPos,
|
||||
p_stVertex12,
|
||||
p_stObject,
|
||||
PIC_C_DepthPickingElements,
|
||||
&xNbElements,
|
||||
p_stPickedObject->aDEF_stDataOfElement);
|
||||
break;
|
||||
|
||||
case PIC_C_ModePickingPoint:
|
||||
bTest = INT_fn_bIntersectSemiAxeWithPointOfGeometricObject(p_stCameraPos,
|
||||
p_stVertex12,
|
||||
p_stObject,
|
||||
PIC_C_DepthPickingElements,
|
||||
&xNbElements,
|
||||
p_stPickedObject->aDEF_stDataOfElement);
|
||||
break;
|
||||
}
|
||||
|
||||
if( bTest ) // l'objet est sous la souris
|
||||
{
|
||||
MTH3D_tdstVector stTemp;
|
||||
ACP_tdxIndex i;
|
||||
|
||||
POS_fn_vMulMatrixVertex(&stTemp, g_p_stCurrentMatrix, p_stCameraPos);
|
||||
|
||||
for(i=0; i<xNbElements; i++)
|
||||
{
|
||||
|
||||
POS_fn_vMulMatrixVertex(&(p_stPickedObject->aDEF_stDataOfElement[i].stHit),
|
||||
g_p_stCurrentMatrix,
|
||||
&(p_stPickedObject->aDEF_stDataOfElement[i].stHit));
|
||||
|
||||
switch(xModePicking)
|
||||
{
|
||||
case PIC_C_ModePickingFace:
|
||||
p_stPickedObject->aDEF_stDataOfElement[i].xDistance =
|
||||
MTH3D_M_xVectorGap(&stTemp, &(p_stPickedObject->aDEF_stDataOfElement[i].stHit));
|
||||
break;
|
||||
|
||||
case PIC_C_ModePickingEdge:
|
||||
p_stPickedObject->aDEF_stDataOfElement[i].xDistance =
|
||||
MTH3D_M_xVectorGap(&(p_stPickedObject->aDEF_stDataOfElement[i].stHit),
|
||||
p_stObject->d_stListOfPoints + p_stPickedObject->aDEF_stDataOfElement[i].xIndexOfEdge);
|
||||
break;
|
||||
|
||||
case PIC_C_ModePickingPoint:
|
||||
p_stPickedObject->aDEF_stDataOfElement[i].xDistance =
|
||||
MTH3D_M_xVectorGap(&(p_stPickedObject->aDEF_stDataOfElement[i].stHit),
|
||||
p_stObject->d_stListOfPoints + p_stPickedObject->aDEF_stDataOfElement[i].xIndexOfPoint);
|
||||
break;
|
||||
}
|
||||
}
|
||||
p_stPickedObject->xNbElements = xNbElements;
|
||||
p_stPickedObject->xModePicking = xModePicking;
|
||||
|
||||
bReturn = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return bReturn;
|
||||
}
|
||||
#endif // ACTIVE_EDITOR
|
||||
|
5
Rayman_X/cpa/tempgrp/PIC/mssccprj.scc
Normal file
5
Rayman_X/cpa/tempgrp/PIC/mssccprj.scc
Normal file
@@ -0,0 +1,5 @@
|
||||
SCC = This is a source code control file
|
||||
|
||||
[Pic.vcproj]
|
||||
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
|
||||
SCC_Project_Name = Perforce Project
|
Reference in New Issue
Block a user