remove 3rd party libs
This commit is contained in:
parent
7b74950e24
commit
bd062e82af
32 changed files with 0 additions and 7539 deletions
Binary file not shown.
|
@ -1,265 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelBaseTypes.h
|
||||
|
||||
PURPOSE: Base Types for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 10/29/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELBASETYPES_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELBASETYPES_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//#include <windows.h>
|
||||
#include "FeelitApi.h"
|
||||
|
||||
#ifndef FFC_VERSION
|
||||
#define FFC_VERSION 0x0100
|
||||
#endif
|
||||
|
||||
#if (FFC_VERSION >= 0x0110)
|
||||
#define FFC_START_DELAY
|
||||
#define FFC_EFFECT_CACHING
|
||||
#endif
|
||||
|
||||
// These are defined in FEELitAPI.h
|
||||
//
|
||||
// #define FEELIT_DEVICETYPE_DEVICE 1
|
||||
// #define FEELIT_DEVICETYPE_MOUSE 2
|
||||
// #define FEELIT_DEVICETYPE_HID 0x00010000
|
||||
//
|
||||
// Add define for DirectInput Device emulating FEELit Device
|
||||
#define FEELIT_DEVICETYPE_DIRECTINPUT 3
|
||||
|
||||
|
||||
//================================================================
|
||||
// TYPE WRAPPERS
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// FEEL --> FEELIT Wrappers
|
||||
//
|
||||
#define FEEL_DEVICETYPE_DEVICE FEELIT_DEVICETYPE_DEVICE
|
||||
#define FEEL_DEVICETYPE_MOUSE FEELIT_DEVICETYPE_MOUSE
|
||||
#define FEEL_DEVICETYPE_DIRECTINPUT FEELIT_DEVICETYPE_DIRECTINPUT
|
||||
|
||||
#define FEEL_EFFECT FEELIT_EFFECT
|
||||
#define LPFEEL_EFFECT LPFEELIT_EFFECT
|
||||
#define LPCFEEL_EFFECT LPCFEELIT_EFFECT
|
||||
|
||||
#define FEEL_CONDITION FEELIT_CONDITION
|
||||
#define LPFEEL_CONDITION LPFEELIT_CONDITION
|
||||
#define LPCFEEL_CONDITION LPCFEELIT_CONDITION
|
||||
|
||||
#define FEEL_TEXTURE FEELIT_TEXTURE
|
||||
#define LPFEEL_TEXTURE LPFEELIT_TEXTURE
|
||||
#define LPCFEEL_TEXTURE LPCFEELIT_TEXTURE
|
||||
|
||||
#define FEEL_PERIODIC FEELIT_PERIODIC
|
||||
#define LPFEEL_PERIODIC LPFEELIT_PERIODIC
|
||||
#define LPCFEEL_PERIODIC LPCFEELIT_PERIODIC
|
||||
|
||||
#define FEEL_CONSTANTFORCE FEELIT_CONSTANTFORCE
|
||||
#define LPFEEL_CONSTANTFORCE LPFEELIT_CONSTANTFORCE
|
||||
#define LPCFEEL_CONSTANTFORCE LPCFEELIT_CONSTANTFORCE
|
||||
|
||||
#define FEEL_RAMPFORCE FEELIT_RAMPFORCE
|
||||
#define LPFEEL_RAMPFORCE LPFEELIT_RAMPFORCE
|
||||
#define LPCFEEL_RAMPFORCE LPCFEELIT_RAMPFORCE
|
||||
|
||||
#define FEEL_ENVELOPE FEELIT_ENVELOPE
|
||||
#define LPFEEL_ENVELOPE LPFEELIT_ENVELOPE
|
||||
#define LPCFEEL_ENVELOPE LPCFEELIT_ENVELOPE
|
||||
|
||||
#define LPIFEEL_API LPIFEELIT
|
||||
#define LPIFEEL_EFFECT LPIFEELIT_EFFECT
|
||||
#define LPIFEEL_DEVICE LPIFEELIT_DEVICE
|
||||
|
||||
#define LPFEEL_DEVICEINSTANCE LPFEELIT_DEVICEINSTANCE
|
||||
#define LPCFEEL_DEVICEOBJECTINSTANCE LPCFEELIT_DEVICEOBJECTINSTANCE
|
||||
#define LPCFEEL_EFFECTINFO LPCFEELIT_EFFECTINFO
|
||||
|
||||
|
||||
#define FEEL_FPARAM_DURATION FEELIT_FPARAM_DURATION
|
||||
#define FEEL_FPARAM_SAMPLEPERIOD FEELIT_FPARAM_SAMPLEPERIOD
|
||||
#define FEEL_FPARAM_GAIN FEELIT_FPARAM_GAIN
|
||||
#define FEEL_FPARAM_TRIGGERBUTTON FEELIT_FPARAM_TRIGGERBUTTON
|
||||
#define FEEL_FPARAM_TRIGGERREPEATINTERVAL FEELIT_FPARAM_TRIGGERREPEATINTERVAL
|
||||
#define FEEL_FPARAM_AXES FEELIT_FPARAM_AXES
|
||||
#define FEEL_FPARAM_DIRECTION FEELIT_FPARAM_DIRECTION
|
||||
#define FEEL_FPARAM_ENVELOPE FEELIT_FPARAM_ENVELOPE
|
||||
#define FEEL_FPARAM_TYPESPECIFICPARAMS FEELIT_FPARAM_TYPESPECIFICPARAMS
|
||||
#define FEEL_FPARAM_ALLPARAMS FEELIT_FPARAM_ALLPARAMS
|
||||
#define FEEL_FPARAM_START FEELIT_FPARAM_START
|
||||
#define FEEL_FPARAM_NORESTART FEELIT_FPARAM_NORESTART
|
||||
#define FEEL_FPARAM_NODOWNLOAD FEELIT_FPARAM_NODOWNLOAD
|
||||
|
||||
#define FEEL_FEFFECT_OBJECTIDS FEELIT_FEFFECT_OBJECTIDS
|
||||
#define FEEL_FEFFECT_OBJECTOFFSETS FEELIT_FEFFECT_OBJECTOFFSETS
|
||||
#define FEEL_FEFFECT_CARTESIAN FEELIT_FEFFECT_CARTESIAN
|
||||
#define FEEL_FEFFECT_POLAR FEELIT_FEFFECT_POLAR
|
||||
#define FEEL_FEFFECT_SPHERICAL FEELIT_FEFFECT_SPHERICAL
|
||||
|
||||
#define FEEL_PARAM_NOTRIGGER FEELIT_PARAM_NOTRIGGER
|
||||
|
||||
#define FEEL_MOUSEOFFSET_XAXIS FEELIT_MOUSEOFFSET_XAXIS
|
||||
#define FEEL_MOUSEOFFSET_YAXIS FEELIT_MOUSEOFFSET_YAXIS
|
||||
#define FEEL_MOUSEOFFSET_ZAXIS FEELIT_MOUSEOFFSET_ZAXIS
|
||||
|
||||
//
|
||||
// FORCE --> FEELIT Wrappers
|
||||
//
|
||||
#define FORCE_EFFECT FEELIT_EFFECT
|
||||
#define LPFORCE_EFFECT LPFEELIT_EFFECT
|
||||
#define LPCFORCE_EFFECT LPCFEELIT_EFFECT
|
||||
|
||||
#define FORCE_CONDITION FEELIT_CONDITION
|
||||
#define LPFORCE_CONDITION LPFEELIT_CONDITION
|
||||
#define LPCFORCE_CONDITION LPCFEELIT_CONDITION
|
||||
|
||||
#define FORCE_TEXTURE FEELIT_TEXTURE
|
||||
#define LPFORCE_TEXTURE LPFEELIT_TEXTURE
|
||||
#define LPCFORCE_TEXTURE LPCFEELIT_TEXTURE
|
||||
|
||||
#define FORCE_PERIODIC FEELIT_PERIODIC
|
||||
#define LPFORCE_PERIODIC LPFEELIT_PERIODIC
|
||||
#define LPCFORCE_PERIODIC LPCFEELIT_PERIODIC
|
||||
|
||||
#define FORCE_CONSTANTFORCE FEELIT_CONSTANTFORCE
|
||||
#define LPFORCE_CONSTANTFORCE LPFEELIT_CONSTANTFORCE
|
||||
#define LPCFORCE_CONSTANTFORCE LPCFEELIT_CONSTANTFORCE
|
||||
|
||||
#define FORCE_RAMPFORCE FEELIT_RAMPFORCE
|
||||
#define LPFORCE_RAMPFORCE LPFEELIT_RAMPFORCE
|
||||
#define LPCFORCE_RAMPFORCE LPCFEELIT_RAMPFORCE
|
||||
|
||||
#define FORCE_ENVELOPE FEELIT_ENVELOPE
|
||||
#define LPFORCE_ENVELOPE LPFEELIT_ENVELOPE
|
||||
#define LPCFORCE_ENVELOPE LPCFEELIT_ENVELOPE
|
||||
|
||||
#define LPIFORCE_API LPIFEELIT
|
||||
#define LPIFORCE_EFFECT LPIFEELIT_EFFECT
|
||||
#define LPIFORCE_DEVICE LPIFEELIT_DEVICE
|
||||
|
||||
#define LPFORCE_DEVICEINSTANCE LPFEELIT_DEVICEINSTANCE
|
||||
#define LPCFORCE_DEVICEOBJECTINSTANCE LPCFEELIT_DEVICEOBJECTINSTANCE
|
||||
#define LPCFORCE_EFFECTINFO LPCFEELIT_EFFECTINFO
|
||||
|
||||
|
||||
#define FORCE_FPARAM_DURATION FEELIT_FPARAM_DURATION
|
||||
#define FORCE_FPARAM_SAMPLEPERIOD FEELIT_FPARAM_SAMPLEPERIOD
|
||||
#define FORCE_FPARAM_GAIN FEELIT_FPARAM_GAIN
|
||||
#define FORCE_FPARAM_TRIGGERBUTTON FEELIT_FPARAM_TRIGGERBUTTON
|
||||
#define FORCE_FPARAM_TRIGGERREPEATINTERVAL FEELIT_FPARAM_TRIGGERREPEATINTERVAL
|
||||
#define FORCE_FPARAM_AXES FEELIT_FPARAM_AXES
|
||||
#define FORCE_FPARAM_DIRECTION FEELIT_FPARAM_DIRECTION
|
||||
#define FORCE_FPARAM_ENVELOPE FEELIT_FPARAM_ENVELOPE
|
||||
#define FORCE_FPARAM_TYPESPECIFICPARAMS FEELIT_FPARAM_TYPESPECIFICPARAMS
|
||||
#define FORCE_FPARAM_ALLPARAMS FEELIT_FPARAM_ALLPARAMS
|
||||
#define FORCE_FPARAM_START FEELIT_FPARAM_START
|
||||
#define FORCE_FPARAM_NORESTART FEELIT_FPARAM_NORESTART
|
||||
#define FORCE_FPARAM_NODOWNLOAD FEELIT_FPARAM_NODOWNLOAD
|
||||
|
||||
#define FORCE_FEFFECT_OBJECTIDS FEELIT_FEFFECT_OBJECTIDS
|
||||
#define FORCE_FEFFECT_OBJECTOFFSETS FEELIT_FEFFECT_OBJECTOFFSETS
|
||||
#define FORCE_FEFFECT_CARTESIAN FEELIT_FEFFECT_CARTESIAN
|
||||
#define FORCE_FEFFECT_POLAR FEELIT_FEFFECT_POLAR
|
||||
#define FORCE_FEFFECT_SPHERICAL FEELIT_FEFFECT_SPHERICAL
|
||||
|
||||
#define FORCE_PARAM_NOTRIGGER FEELIT_PARAM_NOTRIGGER
|
||||
|
||||
#define FORCE_MOUSEOFFSET_XAXIS FEELIT_MOUSEOFFSET_XAXIS
|
||||
#define FORCE_MOUSEOFFSET_YAXIS FEELIT_MOUSEOFFSET_YAXIS
|
||||
#define FORCE_MOUSEOFFSET_ZAXIS FEELIT_MOUSEOFFSET_ZAXIS
|
||||
|
||||
|
||||
//================================================================
|
||||
// GUID WRAPPERS
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// Feel --> Feelit Wrappers
|
||||
//
|
||||
#define GUID_Feel_ConstantForce GUID_Feelit_ConstantForce
|
||||
#define GUID_Feel_RampForce GUID_Feelit_RampForce
|
||||
#define GUID_Feel_Square GUID_Feelit_Square
|
||||
#define GUID_Feel_Sine GUID_Feelit_Sine
|
||||
#define GUID_Feel_Triangle GUID_Feelit_Triangle
|
||||
#define GUID_Feel_SawtoothUp GUID_Feelit_SawtoothUp
|
||||
#define GUID_Feel_SawtoothDown GUID_Feelit_SawtoothDown
|
||||
#define GUID_Feel_Spring GUID_Feelit_Spring
|
||||
#define GUID_Feel_DeviceSpring GUID_Feelit_DeviceSpring
|
||||
#define GUID_Feel_Damper GUID_Feelit_Damper
|
||||
#define GUID_Feel_Inertia GUID_Feelit_Inertia
|
||||
#define GUID_Feel_Friction GUID_Feelit_Friction
|
||||
#define GUID_Feel_Texture GUID_Feelit_Texture
|
||||
#define GUID_Feel_Grid GUID_Feelit_Grid
|
||||
#define GUID_Feel_Enclosure GUID_Feelit_Enclosure
|
||||
#define GUID_Feel_Ellipse GUID_Feelit_Ellipse
|
||||
#define GUID_Feel_CustomForce GUID_Feelit_CustomForce
|
||||
|
||||
//
|
||||
// Force --> Feelit Wrappers
|
||||
//
|
||||
#define GUID_Force_ConstantForce GUID_Feelit_ConstantForce
|
||||
#define GUID_Force_RampForce GUID_Feelit_RampForce
|
||||
#define GUID_Force_Square GUID_Feelit_Square
|
||||
#define GUID_Force_Sine GUID_Feelit_Sine
|
||||
#define GUID_Force_Triangle GUID_Feelit_Triangle
|
||||
#define GUID_Force_SawtoothUp GUID_Feelit_SawtoothUp
|
||||
#define GUID_Force_SawtoothDown GUID_Feelit_SawtoothDown
|
||||
#define GUID_Force_Spring GUID_Feelit_Spring
|
||||
#define GUID_Force_Damper GUID_Feelit_Damper
|
||||
#define GUID_Force_Inertia GUID_Feelit_Inertia
|
||||
#define GUID_Force_Friction GUID_Feelit_Friction
|
||||
#define GUID_Force_Texture GUID_Feelit_Texture
|
||||
#define GUID_Force_Grid GUID_Feelit_Grid
|
||||
#define GUID_Force_Enclosure GUID_Feelit_Enclosure
|
||||
#define GUID_Force_Ellipse GUID_Feelit_Ellipse
|
||||
#define GUID_Force_CustomForce GUID_Feelit_CustomForce
|
||||
|
||||
|
||||
#endif // !defined(AFX_FEELBASETYPES_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelBox.h
|
||||
|
||||
PURPOSE: Box Class for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 11/04/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELBOX_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELBOX_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelEffect.h"
|
||||
#include "FeelEnclosure.h"
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
const POINT FEEL_BOX_MOUSE_POS_AT_START = { MAXLONG, MAXLONG };
|
||||
|
||||
#define FEEL_BOX_DEFAULT_STIFFNESS 5000
|
||||
#define FEEL_BOX_DEFAULT_WIDTH 10
|
||||
#define FEEL_BOX_DEFAULT_HEIGHT FEEL_ENCLOSURE_HEIGHT_AUTO
|
||||
#define FEEL_BOX_DEFAULT_WALL_WIDTH FEEL_ENCLOSURE_WALL_WIDTH_AUTO
|
||||
|
||||
#define FEEL_BOX_DEFAULT_CENTER_POINT FEEL_BOX_MOUSE_POS_AT_START
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_BOX_MOUSE_POS_AT_START FEEL_BOX_DEFAULT_STIFFNESS
|
||||
|
||||
#define FORCE_BOX_DEFAULT_STIFFNESS FEEL_BOX_DEFAULT_STIFFNESS
|
||||
#define FORCE_BOX_DEFAULT_WIDTH FEEL_BOX_DEFAULT_WIDTH
|
||||
#define FORCE_BOX_DEFAULT_HEIGHT FEEL_BOX_DEFAULT_HEIGHT
|
||||
#define FORCE_BOX_DEFAULT_WALL_WIDTH FEEL_BOX_DEFAULT_WALL_WIDTH
|
||||
|
||||
#define FORCE_BOX_DEFAULT_CENTER_POINT FEEL_BOX_DEFAULT_CENTER_POINT
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelBox
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelBox : public CFeelEnclosure
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESCTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelBox();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelBox();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
POINT pntCenter,
|
||||
LONG lStiffness = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwHeight = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwWallWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
LPCRECT pRectOutside,
|
||||
LONG lStiffness = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwWallWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
|
||||
BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwWidth = FEEL_ENCLOSURE_DEFAULT_WIDTH,
|
||||
DWORD dwHeight = FEEL_ENCLOSURE_DEFAULT_HEIGHT,
|
||||
LONG lStiffness = FEEL_BOX_DEFAULT_STIFFNESS,
|
||||
DWORD dwWallWidth = FEEL_BOX_DEFAULT_WALL_WIDTH,
|
||||
POINT pntCenter = FEEL_BOX_DEFAULT_CENTER_POINT,
|
||||
CFeelEffect* pInsideEffect = NULL
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
LPCRECT pRectOutside,
|
||||
LONG lStiffness = FEEL_BOX_DEFAULT_STIFFNESS,
|
||||
DWORD dwWallWidth = FEEL_BOX_DEFAULT_WALL_WIDTH,
|
||||
CFeelEffect* pInsideEffect = NULL
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // !defined(AFX_FEELBOX_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,184 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1999 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelCompoundEffect.h
|
||||
|
||||
PURPOSE: Manages Compound Effects for Force Foundation Classes
|
||||
|
||||
STARTED: 2/24/99 by Jeff Mallett
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(__FEELCOMPOUNDEFFECT_H)
|
||||
#define __FEELCOMPOUNDEFFECT_H
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelEffect.h"
|
||||
|
||||
#include "FeelitIFR.h"
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelCompoundEffect
|
||||
//================================================================
|
||||
// Represents a compound effect, such as might be created in
|
||||
// I-FORCE Studio. Contains an array of effect objects.
|
||||
// Methods iterate over component effects, passing the message
|
||||
// to each one.
|
||||
// Also, has stuff for being used by CFeelProject:
|
||||
// * next pointer so can be put on a linked list
|
||||
// * force name
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelCompoundEffect
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
protected:
|
||||
// Constructs a CFeelCompoundEffect
|
||||
// Don't try to construct a CFeelCompoundEffect yourself.
|
||||
// Instead let CFeelProject construct it for you.
|
||||
CFeelCompoundEffect(
|
||||
IFREffect **hEffects,
|
||||
long nEffects
|
||||
);
|
||||
|
||||
public:
|
||||
|
||||
~CFeelCompoundEffect();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
long
|
||||
GetNumberOfContainedEffects() const
|
||||
{ return m_nEffects; }
|
||||
|
||||
const char *
|
||||
GetName() const
|
||||
{ return m_lpszName; }
|
||||
|
||||
GENERIC_EFFECT_PTR
|
||||
GetContainedEffect(
|
||||
long index
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Start all the contained effects
|
||||
BOOL Start(
|
||||
DWORD dwIterations = 1,
|
||||
DWORD dwFlags = 0
|
||||
);
|
||||
|
||||
// Stop all the contained effects
|
||||
BOOL Stop();
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
BOOL initialize(
|
||||
CFeelDevice* pDevice,
|
||||
IFREffect **hEffects
|
||||
);
|
||||
|
||||
BOOL
|
||||
set_contained_effect(
|
||||
GENERIC_EFFECT_PTR pObject,
|
||||
int index = 0
|
||||
);
|
||||
|
||||
BOOL
|
||||
set_name(
|
||||
const char *lpszName
|
||||
);
|
||||
|
||||
void
|
||||
set_next(
|
||||
CFeelCompoundEffect *pNext
|
||||
)
|
||||
{ m_pNext = pNext; }
|
||||
|
||||
CFeelCompoundEffect *
|
||||
get_next() const
|
||||
{ return m_pNext; }
|
||||
|
||||
|
||||
//
|
||||
// FRIENDS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
friend class CFeelProject;
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
GENERIC_EFFECT_PTR *m_paEffects; // Array of force class object pointers
|
||||
long m_nEffects; // Number of effects in m_paEffects
|
||||
|
||||
private:
|
||||
|
||||
char *m_lpszName; // Name of the compound effect
|
||||
CFeelCompoundEffect *m_pNext; // Next compound effect in the project
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,345 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelCondition.h
|
||||
|
||||
PURPOSE: Base Condition Class for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 10/10/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELCONDITION_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELCONDITION_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelEffect.h"
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
const POINT FEEL_CONDITION_PT_NULL = { 0, 0 };
|
||||
|
||||
#define FEEL_CONDITION_DEFAULT_COEFFICIENT 2500
|
||||
#define FEEL_CONDITION_DEFAULT_SATURATION 10000
|
||||
#define FEEL_CONDITION_DEFAULT_DEADBAND 100
|
||||
#define FEEL_CONDITION_DEFAULT_CENTER_POINT FEEL_EFFECT_MOUSE_POS_AT_START
|
||||
#define FEEL_CONDITION_DEFAULT_DURATION INFINITE
|
||||
|
||||
typedef enum {
|
||||
FC_NULL = 0,
|
||||
FC_POSITIVE_COEFFICIENT,
|
||||
FC_NEGATIVE_COEFFICIENT,
|
||||
FC_POSITIVE_SATURATION,
|
||||
FC_NEGATIVE_SATURATION,
|
||||
FC_DEAD_BAND,
|
||||
FC_AXIS,
|
||||
FC_CENTER,
|
||||
FC_DIRECTION_X,
|
||||
FC_DIRECTION_Y,
|
||||
FC_ANGLE,
|
||||
FC_CONDITION_X,
|
||||
FC_CONDITION_Y
|
||||
} FC_ArgumentType;
|
||||
|
||||
#define FC_CONDITION FC_CONDITION_X
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_CONDITION_PT_NULL FEEL_CONDITION_PT_NULL
|
||||
|
||||
#define FORCE_CONDITION_DEFAULT_COEFFICIENT FEEL_CONDITION_DEFAULT_COEFFICIENT
|
||||
#define FORCE_CONDITION_DEFAULT_SATURATION FEEL_CONDITION_DEFAULT_SATURATION
|
||||
#define FORCE_CONDITION_DEFAULT_DEADBAND FEEL_CONDITION_DEFAULT_DEADBAND
|
||||
#define FORCE_CONDITION_DEFAULT_CENTER_POINT FEEL_CONDITION_DEFAULT_CENTER_POINT
|
||||
#define FORCE_CONDITION_DEFAULT_DURATION FEEL_CONDITION_DEFAULT_DURATION
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelCondition
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelCondition : public CFeelEffect
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESCTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelCondition(
|
||||
const GUID& rguidEffect
|
||||
);
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelCondition();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
// Use this form for single-axis and dual-axis effects
|
||||
BOOL
|
||||
ChangeConditionParams(
|
||||
LPCFEELIT_CONDITION pConditionX,
|
||||
LPCFEELIT_CONDITION pConditionY
|
||||
);
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
ChangeConditionParams(
|
||||
LPCFEELIT_CONDITION pCondition,
|
||||
LONG lDirectionX,
|
||||
LONG lDirectionY
|
||||
);
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
ChangeConditionParamsPolar(
|
||||
LPCFEELIT_CONDITION pCondition,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
// Use this form for single-axis, dual-axis symetrical, or directional effects
|
||||
BOOL
|
||||
ChangeConditionParams(
|
||||
LONG lPositiveCoefficient,
|
||||
LONG lNegativeCoefficient = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwPositiveSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwNegativeSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDeadBand = FEEL_EFFECT_DONT_CHANGE,
|
||||
POINT pntCenter = FEEL_EFFECT_DONT_CHANGE_POINT,
|
||||
LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
// Use this form for single-axis, dual-axis symetrical, or directional effects
|
||||
BOOL
|
||||
ChangeConditionParamsPolar(
|
||||
LONG lPositiveCoefficient,
|
||||
LONG lNegativeCoefficient,
|
||||
DWORD dwPositiveSaturation,
|
||||
DWORD dwNegativeSaturation,
|
||||
LONG lDeadBand,
|
||||
POINT pntCenter,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
SetCenter(
|
||||
POINT pntCenter
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeConditionParams2(
|
||||
FC_ArgumentType type,
|
||||
...
|
||||
);
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
const FEEL_EFFECT &effect
|
||||
);
|
||||
|
||||
// Use this form for single-axis and dual-axis effects
|
||||
BOOL
|
||||
InitCondition(
|
||||
CFeelDevice* pDevice,
|
||||
LPCFEELIT_CONDITION pConditionX,
|
||||
LPCFEELIT_CONDITION pConditionY,
|
||||
BOOL bUseDeviceCoordinates = FALSE
|
||||
);
|
||||
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
InitCondition(
|
||||
CFeelDevice* pDevice,
|
||||
LPCFEELIT_CONDITION pCondition,
|
||||
LONG lDirectionX,
|
||||
LONG lDirectionY,
|
||||
BOOL bUseDeviceCoordinates = FALSE
|
||||
);
|
||||
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
InitConditionPolar(
|
||||
CFeelDevice* pDevice,
|
||||
LPCFEELIT_CONDITION pCondition,
|
||||
LONG lAngle,
|
||||
BOOL bUseDeviceCoordinates = FALSE
|
||||
);
|
||||
|
||||
|
||||
// Use this form for single-axis, dual-axis symetrical, or directional effects
|
||||
BOOL
|
||||
InitCondition(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lPositiveCoefficient = FEEL_CONDITION_DEFAULT_COEFFICIENT,
|
||||
LONG lNegativeCoefficient = FEEL_CONDITION_DEFAULT_COEFFICIENT,
|
||||
DWORD dwPositiveSaturation = FEEL_CONDITION_DEFAULT_SATURATION,
|
||||
DWORD dwNegativeSaturation = FEEL_CONDITION_DEFAULT_SATURATION,
|
||||
LONG lDeadBand = FEEL_CONDITION_DEFAULT_DEADBAND,
|
||||
DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH,
|
||||
POINT pntCenter = FEEL_CONDITION_DEFAULT_CENTER_POINT,
|
||||
LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X,
|
||||
LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y,
|
||||
BOOL bUseDeviceCoordinates = FALSE
|
||||
);
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
InitConditionPolar(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lPositiveCoefficient = FEEL_CONDITION_DEFAULT_COEFFICIENT,
|
||||
LONG lNegativeCoefficient = FEEL_CONDITION_DEFAULT_COEFFICIENT,
|
||||
DWORD dwPositiveSaturation = FEEL_CONDITION_DEFAULT_SATURATION,
|
||||
DWORD dwNegativeSaturation = FEEL_CONDITION_DEFAULT_SATURATION,
|
||||
LONG lDeadBand = FEEL_CONDITION_DEFAULT_DEADBAND,
|
||||
POINT pntCenter = FEEL_CONDITION_DEFAULT_CENTER_POINT,
|
||||
LONG lAngle = FEEL_EFFECT_DEFAULT_ANGLE,
|
||||
BOOL bUseDeviceCoordinates = FALSE
|
||||
);
|
||||
|
||||
|
||||
virtual BOOL
|
||||
#ifdef FFC_START_DELAY
|
||||
StartNow(
|
||||
#else
|
||||
Start(
|
||||
#endif
|
||||
DWORD dwIterations = 1,
|
||||
DWORD dwFlags = 0
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
void
|
||||
convert_line_point_to_offset(
|
||||
POINT pntOnLine
|
||||
);
|
||||
|
||||
BOOL
|
||||
set_parameters(
|
||||
DWORD dwfAxis,
|
||||
DWORD dwfCoordinates,
|
||||
LONG lDirection0,
|
||||
LONG lDirection1,
|
||||
LPCFEELIT_CONDITION pConditionX,
|
||||
LPCFEELIT_CONDITION pConditionY
|
||||
);
|
||||
|
||||
BOOL
|
||||
set_parameters(
|
||||
DWORD dwfAxis,
|
||||
DWORD dwfCoordinates,
|
||||
LONG lDirection0,
|
||||
LONG lDirection1,
|
||||
LONG lPositiveCoefficient,
|
||||
LONG lNegativeCoefficient,
|
||||
DWORD dwPositiveSaturation,
|
||||
DWORD dwNegativeSaturation,
|
||||
LONG lDeadBand,
|
||||
POINT pntCenter
|
||||
);
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
FEEL_CONDITION m_aCondition[2];
|
||||
DWORD m_dwfAxis;
|
||||
BOOL m_bUseMousePosAtStart;
|
||||
|
||||
protected:
|
||||
BOOL m_bUseDeviceCoordinates;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelCondition::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Spring) ||
|
||||
IsEqualGUID(guid, GUID_Feel_DeviceSpring) ||
|
||||
IsEqualGUID(guid, GUID_Feel_Damper) ||
|
||||
IsEqualGUID(guid, GUID_Feel_Inertia) ||
|
||||
IsEqualGUID(guid, GUID_Feel_Friction) ||
|
||||
IsEqualGUID(guid, GUID_Feel_Texture) ||
|
||||
IsEqualGUID(guid, GUID_Feel_Grid);
|
||||
}
|
||||
|
||||
#endif // !defined(AFX_FEELCONDITION_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,193 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelConstant.h
|
||||
|
||||
PURPOSE: Base Constant Class for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 11/03/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELCONSTANT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELCONSTANT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelEffect.h"
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
const POINT FEEL_CONSTANT_DEFAULT_DIRECTION = { 1, 0 };
|
||||
#define FEEL_CONSTANT_DEFAULT_DURATION 1000 // Milliseconds
|
||||
#define FEEL_CONSTANT_DEFAULT_MAGNITUDE 5000
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_CONSTANT_DEFAULT_DIRECTION FEEL_CONSTANT_DEFAULT_DIRECTION
|
||||
#define FORCE_CONSTANT_DEFAULT_DURATION FEEL_CONSTANT_DEFAULT_DURATION
|
||||
#define FORCE_CONSTANT_DEFAULT_MAGNITUDE FEEL_CONSTANT_DEFAULT_MAGNITUDE
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelConstant
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelConstant : public CFeelEffect
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelConstant();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelConstant();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
LONG lDirectionX,
|
||||
LONG lDirectionY,
|
||||
DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lMagnitude = FEEL_EFFECT_DONT_CHANGE,
|
||||
LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParametersPolar(
|
||||
LONG lAngle,
|
||||
DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lMagnitude = FEEL_EFFECT_DONT_CHANGE,
|
||||
LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual
|
||||
BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X,
|
||||
LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y,
|
||||
DWORD dwDuration = FEEL_CONSTANT_DEFAULT_DURATION,
|
||||
LONG lMagnitude = FEEL_CONSTANT_DEFAULT_MAGNITUDE,
|
||||
LPFEEL_ENVELOPE pEnvelope = NULL
|
||||
);
|
||||
|
||||
virtual
|
||||
BOOL
|
||||
InitializePolar(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lArray = FEEL_EFFECT_DEFAULT_ANGLE,
|
||||
DWORD dwDuration = FEEL_CONSTANT_DEFAULT_DURATION,
|
||||
LONG lMagnitude = FEEL_CONSTANT_DEFAULT_MAGNITUDE,
|
||||
LPFEEL_ENVELOPE pEnvelope = NULL
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
BOOL
|
||||
set_parameters(
|
||||
DWORD dwfCoordinates,
|
||||
LONG lDirection0,
|
||||
LONG lDirection1,
|
||||
DWORD dwDuration,
|
||||
LONG lMagnitude,
|
||||
LPFEEL_ENVELOPE pEnvelope
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
FEEL_CONSTANTFORCE m_ConstantForce;
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelConstant::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_ConstantForce);
|
||||
}
|
||||
|
||||
|
||||
#endif // !defined(AFX_FEELCONSTANT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,177 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997,8,9 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelDamper.h
|
||||
|
||||
PURPOSE: Feelit API Damper Effect Class
|
||||
|
||||
STARTED: 10/14/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELDamper_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELDamper_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include "FeelCondition.h"
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
#define FEEL_DAMPER_DEFAULT_VISCOSITY 2500
|
||||
#define FEEL_DAMPER_DEFAULT_SATURATION 10000
|
||||
#define FEEL_DAMPER_DEFAULT_MIN_VELOCITY 0
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_DAMPER_DEFAULT_VISCOSITY FEEL_DAMPER_DEFAULT_VISCOSITY
|
||||
#define FORCE_DAMPER_DEFAULT_SATURATION FEEL_DAMPER_DEFAULT_SATURATION
|
||||
#define FORCE_DAMPER_DEFAULT_MIN_VELOCITY FEEL_DAMPER_DEFAULT_MIN_VELOCITY
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelDamper
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelDamper : public CFeelCondition
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelDamper();
|
||||
|
||||
// Destructor
|
||||
virtual ~CFeelDamper();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
DWORD dwViscosity,
|
||||
DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwMinVelocity = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParametersPolar(
|
||||
DWORD dwViscosity,
|
||||
DWORD dwSaturation,
|
||||
DWORD dwMinVelocity,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwViscosity = FEEL_DAMPER_DEFAULT_VISCOSITY,
|
||||
DWORD dwSaturation = FEEL_DAMPER_DEFAULT_SATURATION,
|
||||
DWORD dwMinVelocity = FEEL_DAMPER_DEFAULT_MIN_VELOCITY,
|
||||
DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH,
|
||||
LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X,
|
||||
LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y
|
||||
);
|
||||
|
||||
virtual BOOL
|
||||
InitializePolar(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwViscosity,
|
||||
DWORD dwSaturation,
|
||||
DWORD dwMinVelocity,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelDamper::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Damper);
|
||||
}
|
||||
|
||||
|
||||
#endif // !defined(AFX_FEELDamper_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,195 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelDevice.h
|
||||
|
||||
PURPOSE: Abstract Base Device Class for Force Foundation Classes
|
||||
|
||||
STARTED: 10/10/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
3/16/99 jrm: Made abstract. Moved functionality to CFeelMouse/CFeelDXDevice
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#if !defined(AFX_FORCEDEVICE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FORCEDEVICE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "dinput.h"
|
||||
#include "FeelBaseTypes.h"
|
||||
|
||||
#ifdef FFC_EFFECT_CACHING
|
||||
#include "FeelEffectSuite.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelDevice
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelDevice
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESCTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelDevice();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelDevice();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual LPIFEEL_API
|
||||
GetAPI()
|
||||
= 0; // pure virtual function
|
||||
|
||||
virtual LPIFEEL_DEVICE // Will actually return LPDIRECTINPUTDEVICE2 if non-FEELit
|
||||
GetDevice()
|
||||
= 0; // pure virtual function
|
||||
|
||||
DWORD
|
||||
GetDeviceType() const
|
||||
{ return m_dwDeviceType; }
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
static CFeelDevice *
|
||||
CreateDevice(HINSTANCE hinstApp, HWND hwndApp);
|
||||
|
||||
virtual BOOL
|
||||
ChangeScreenResolution(
|
||||
BOOL bAutoSet,
|
||||
DWORD dwXScreenSize = 0,
|
||||
DWORD dwYScreenSize = 0
|
||||
);
|
||||
|
||||
// The default state is using standard Win32 Mouse messages (e.g., WM_MOUSEMOVE)
|
||||
// and functions (e.g, GetCursorPos). Call only to switch to relative mode
|
||||
// if not using standard Win32 Mouse services (e.g., DirectInput) for mouse
|
||||
// input.
|
||||
BOOL
|
||||
UsesWin32MouseServices(
|
||||
BOOL bWin32MouseServ
|
||||
);
|
||||
|
||||
// Another syntax for SwitchToAbsoluteMode.
|
||||
// The default is Absolute mode. Call only to switch to Relative mode or
|
||||
// to switch back to Absolute mode.
|
||||
virtual BOOL
|
||||
SwitchToAbsoluteMode(
|
||||
BOOL bAbsMode
|
||||
);
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// CACHING
|
||||
//
|
||||
|
||||
#ifdef FFC_EFFECT_CACHING
|
||||
public:
|
||||
|
||||
void Cache_AddEffect(CFeelEffect *pFeelEffect);
|
||||
void Cache_RemoveEffect(const CFeelEffect *pFeelEffect);
|
||||
void Cache_SwapOutEffect();
|
||||
|
||||
protected:
|
||||
|
||||
void Cache_LoadEffectSuite(CFeelEffectSuite *pSuite, BOOL bCreateOnDevice);
|
||||
void Cache_UnloadEffectSuite(CFeelEffectSuite *pSuite, BOOL bUnloadFromDevice);
|
||||
|
||||
CEffectList m_Cache; // List of all effects created on device
|
||||
#endif
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
// Performs device preparation by setting the device's parameters
|
||||
virtual BOOL
|
||||
prepare_device();
|
||||
|
||||
virtual void
|
||||
reset()
|
||||
= 0; // pure virtual function
|
||||
|
||||
static BOOL CALLBACK
|
||||
enum_didevices_proc(
|
||||
LPDIDEVICEINSTANCE pForceDevInst,
|
||||
LPVOID pv
|
||||
);
|
||||
|
||||
static BOOL CALLBACK
|
||||
enum_devices_proc(
|
||||
LPFORCE_DEVICEINSTANCE pForceDevInst,
|
||||
LPVOID pv
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
BOOL m_bInitialized;
|
||||
DWORD m_dwDeviceType;
|
||||
GUID m_guidDevice;
|
||||
BOOL m_bGuidValid;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // !defined(AFX_FORCEDEVICE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,126 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelDXDevice.h
|
||||
|
||||
PURPOSE: Abstraction of DirectX Force Feedback device
|
||||
|
||||
STARTED: 10/10/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef FeelDXDevice_h
|
||||
#define FeelDXDevice_h
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelDevice.h"
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelDXDevice
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelDXDevice : public CFeelDevice
|
||||
{
|
||||
|
||||
//
|
||||
// CONSTRUCTOR/DESCTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelDXDevice();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelDXDevice();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual LPIFEEL_API
|
||||
GetAPI()
|
||||
{ return (LPIFEEL_API) m_piApi; } // actually LPDIRECTINPUT
|
||||
|
||||
virtual LPIFEEL_DEVICE
|
||||
GetDevice()
|
||||
{ return (LPIFEEL_DEVICE) m_piDevice; } // actually LPDIRECTINPUTDEVICE2
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
BOOL
|
||||
Initialize(
|
||||
HANDLE hinstApp,
|
||||
HANDLE hwndApp,
|
||||
LPDIRECTINPUT pDI = NULL,
|
||||
LPDIRECTINPUTDEVICE2 piDevice = NULL
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
virtual void
|
||||
reset();
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
BOOL m_bpDIPreExist;
|
||||
BOOL m_bpDIDevicePreExist;
|
||||
|
||||
LPDIRECTINPUT m_piApi;
|
||||
LPDIRECTINPUTDEVICE2 m_piDevice;
|
||||
};
|
||||
|
||||
#endif // ForceDXDevice_h
|
|
@ -1,344 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelEffect.h
|
||||
|
||||
PURPOSE: Base Effect Class for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 10/10/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID and feel_to_DI_GUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELEFFECT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELEFFECT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelDevice.h"
|
||||
class CFeelProject;
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
#define FEEL_EFFECT_AXIS_X 1
|
||||
#define FEEL_EFFECT_AXIS_Y 2
|
||||
#define FEEL_EFFECT_AXIS_BOTH 3
|
||||
#define FEEL_EFFECT_AXIS_DIRECTIONAL 4
|
||||
#define FEEL_EFFECT_DONT_CHANGE MINLONG
|
||||
#define FEEL_EFFECT_DONT_CHANGE_PTR MAXDWORD
|
||||
const POINT FEEL_EFFECT_DONT_CHANGE_POINT = { 0xFFFFFFFF, 0xFFFFFFFF };
|
||||
const POINT FEEL_EFFECT_MOUSE_POS_AT_START = { MAXLONG, MAXLONG };
|
||||
|
||||
#define FEEL_EFFECT_DEFAULT_ENVELOPE NULL
|
||||
#define FEEL_EFFECT_DEFAULT_DIRECTION_X 1
|
||||
#define FEEL_EFFECT_DEFAULT_DIRECTION_Y 1
|
||||
#define FEEL_EFFECT_DEFAULT_ANGLE 0
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_EFFECT_AXIS_X FEEL_EFFECT_AXIS_X
|
||||
#define FORCE_EFFECT_AXIS_Y FEEL_EFFECT_AXIS_Y
|
||||
#define FORCE_EFFECT_AXIS_BOTH FEEL_EFFECT_AXIS_BOTH
|
||||
#define FORCE_EFFECT_AXIS_DIRECTIONAL FEEL_EFFECT_AXIS_DIRECTIONAL
|
||||
#define FORCE_EFFECT_DONT_CHANGE FEEL_EFFECT_DONT_CHANGE
|
||||
#define FORCE_EFFECT_DONT_CHANGE_PTR FEEL_EFFECT_DONT_CHANGE_PTR
|
||||
#define FORCE_EFFECT_DONT_CHANGE_POINT FEEL_EFFECT_DONT_CHANGE_POINT
|
||||
#define FORCE_EFFECT_MOUSE_POS_AT_START FEEL_EFFECT_MOUSE_POS_AT_START
|
||||
|
||||
#define FORCE_EFFECT_DEFAULT_ENVELOPE FEEL_EFFECT_DEFAULT_ENVELOPE
|
||||
#define FORCE_EFFECT_DEFAULT_DIRECTION_X FEEL_EFFECT_DEFAULT_DIRECTION_X
|
||||
#define FORCE_EFFECT_DEFAULT_DIRECTION_Y FEEL_EFFECT_DEFAULT_DIRECTION_Y
|
||||
#define FORCE_EFFECT_DEFAULT_ANGLE FEEL_EFFECT_DEFAULT_ANGLE
|
||||
|
||||
|
||||
|
||||
// GENERIC_EFFECT_PTR
|
||||
// This is really a pointer to a child of CFeelEffect.
|
||||
typedef class CFeelEffect * GENERIC_EFFECT_PTR;
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelEffect
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelEffect
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelEffect(
|
||||
const GUID& rguidEffect
|
||||
);
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelEffect();
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
LPIFEEL_EFFECT
|
||||
GetEffect()
|
||||
{ return m_piFeelitEffect; }
|
||||
|
||||
BOOL
|
||||
GetStatus(
|
||||
DWORD* pdwStatus
|
||||
)
|
||||
#if (FFC_VERSION >= 0x0110) || defined(FFC_EFFECT_CACHING)
|
||||
const
|
||||
#endif
|
||||
;
|
||||
|
||||
GUID
|
||||
GetGUID()
|
||||
{ return m_guidEffect; }
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID & /* guid */
|
||||
)
|
||||
{ return true; }
|
||||
|
||||
// Allocates an object of the correct FFC class from the given GUID
|
||||
static GENERIC_EFFECT_PTR
|
||||
NewObjectFromGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeBaseParams(
|
||||
LONG lDirectionX,
|
||||
LONG lDirectionY,
|
||||
DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE,
|
||||
LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR,
|
||||
DWORD dwSamplePeriod = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwGain = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwTriggerButton = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwTriggerRepeatInterval = FEEL_EFFECT_DONT_CHANGE
|
||||
#ifdef FFC_START_DELAY
|
||||
,DWORD dwStartDelay = FEEL_EFFECT_DONT_CHANGE
|
||||
#endif
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeBaseParamsPolar(
|
||||
LONG lAngle,
|
||||
DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE,
|
||||
LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR,
|
||||
DWORD dwSamplePeriod = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwGain = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwTriggerButton = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwTriggerRepeatInterval = FEEL_EFFECT_DONT_CHANGE
|
||||
#ifdef FFC_START_DELAY
|
||||
,DWORD dwStartDelay = FEEL_EFFECT_DONT_CHANGE
|
||||
#endif
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeDirection(
|
||||
LONG lDirectionX,
|
||||
LONG lDirectionY
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeDirection(
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
SetEnvelope(
|
||||
DWORD dwAttackLevel,
|
||||
DWORD dwAttackTime,
|
||||
DWORD dwFadeLevel,
|
||||
DWORD dwFadeTime
|
||||
);
|
||||
|
||||
BOOL
|
||||
SetEnvelope(
|
||||
LPFEEL_ENVELOPE pEnvelope
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
const FEEL_EFFECT &effect
|
||||
);
|
||||
|
||||
virtual BOOL
|
||||
InitializeFromProject(
|
||||
CFeelProject &project,
|
||||
LPCSTR lpszEffectName,
|
||||
CFeelDevice* pDevice = NULL
|
||||
);
|
||||
|
||||
virtual BOOL
|
||||
Start(
|
||||
DWORD dwIterations = 1,
|
||||
DWORD dwFlags = 0
|
||||
);
|
||||
|
||||
#ifdef FFC_START_DELAY
|
||||
virtual BOOL
|
||||
StartNow(
|
||||
DWORD dwIterations = 1,
|
||||
DWORD dwFlags = 0
|
||||
);
|
||||
#endif
|
||||
|
||||
virtual BOOL
|
||||
Stop();
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// CACHING
|
||||
//
|
||||
|
||||
#ifdef FFC_EFFECT_CACHING
|
||||
|
||||
public:
|
||||
|
||||
BOOL GetIsPlaying() const;
|
||||
BOOL GetIsTriggered() const;
|
||||
short GetPriority() const { return m_Priority; }
|
||||
void SetPriority(short priority) { m_Priority = priority; }
|
||||
HRESULT Unload();
|
||||
void Reload();
|
||||
|
||||
public:
|
||||
|
||||
ECacheState m_CacheState; // effect's status in the cache
|
||||
BOOL m_bInCurrentSuite; // is the effect in the currently loaded suite?
|
||||
short m_Priority; // Priority within suite: higher number is higher priority
|
||||
DWORD m_dwLastStarted; // when last started (0 = never) or when param change made on device
|
||||
DWORD m_dwLastStopped; // when last stopped (0 = not since last start)
|
||||
DWORD m_dwLastLoaded; // when last loaded with CFeelEffectSuite::Load or Create
|
||||
|
||||
protected:
|
||||
|
||||
CFeelDevice *m_pFeelDevice; // ### Use instead of m_piFeelitDevice
|
||||
#endif
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
protected:
|
||||
|
||||
#ifdef FFC_EFFECT_CACHING
|
||||
public: // initalize needs to be called by CFeelDevice
|
||||
#endif
|
||||
BOOL
|
||||
initialize(
|
||||
CFeelDevice* pDevice
|
||||
);
|
||||
#ifdef FFC_EFFECT_CACHING
|
||||
protected:
|
||||
#endif
|
||||
|
||||
HRESULT
|
||||
set_parameters_on_device(
|
||||
DWORD dwFlags
|
||||
);
|
||||
|
||||
void
|
||||
feel_to_DI_GUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
void
|
||||
reset();
|
||||
|
||||
void
|
||||
reset_effect_struct();
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
FEEL_EFFECT m_Effect;
|
||||
DWORD m_dwaAxes[2];
|
||||
LONG m_laDirections[2];
|
||||
|
||||
GUID m_guidEffect;
|
||||
BOOL m_bIsPlaying;
|
||||
DWORD m_dwDeviceType;
|
||||
LPIFEEL_DEVICE m_piFeelitDevice; // Might also be holding LPDIRECTINPUTDEVICE2
|
||||
LPIFEEL_EFFECT m_piFeelitEffect;
|
||||
DWORD m_cAxes; // Number of axes
|
||||
|
||||
#ifdef FFC_START_DELAY
|
||||
public:
|
||||
// Prevents access to dangling pointer when this is deleted
|
||||
// All relevent code may be removed when all hardware and drivers support start delay
|
||||
CFeelEffect **m_ppTimerRef; // pointer to pointer to this.
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#if (DIRECTINPUT_VERSION >= 0x0700)
|
||||
#define DIRECT_INPUT_STARTDELAY_SUPPORTED TRUE
|
||||
#else
|
||||
#define DIRECT_INPUT_STARTDELAY_SUPPORTED FALSE
|
||||
#endif /* DIRECTINPUT_VERSION >= 0x0700 */
|
||||
|
||||
#endif // !defined(AFX_FEELEFFECT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,253 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelEllipse.h
|
||||
|
||||
PURPOSE: Base Ellipse Class for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 10/29/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELELLIPSE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELELLIPSE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelEffect.h"
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
#define FEEL_ELLIPSE_DEFAULT_STIFFNESS 5000
|
||||
#define FEEL_ELLIPSE_DEFAULT_SATURATION 10000
|
||||
#define FEEL_ELLIPSE_DEFAULT_WIDTH 10
|
||||
#define FEEL_ELLIPSE_HEIGHT_AUTO MAXDWORD
|
||||
#define FEEL_ELLIPSE_DEFAULT_HEIGHT FEEL_ELLIPSE_HEIGHT_AUTO
|
||||
#define FEEL_ELLIPSE_WALL_WIDTH_AUTO MAXDWORD
|
||||
#define FEEL_ELLIPSE_DEFAULT_WALL_WIDTH FEEL_ELLIPSE_WALL_WIDTH_AUTO
|
||||
#define FEEL_ELLIPSE_DEFAULT_STIFFNESS_MASK FEELIT_FSTIFF_ANYWALL
|
||||
#define FEEL_ELLIPSE_DEFAULT_CLIPPING_MASK FEELIT_FCLIP_NONE
|
||||
|
||||
#define FEEL_ELLIPSE_DEFAULT_CENTER_POINT FEEL_EFFECT_MOUSE_POS_AT_START
|
||||
|
||||
//
|
||||
// FEEL --> FORCE Wrappers
|
||||
//
|
||||
#define FORCE_ELLIPSE_DEFAULT_STIFFNESS FEEL_ELLIPSE_DEFAULT_STIFFNESS
|
||||
#define FORCE_ELLIPSE_DEFAULT_SATURATION FEEL_ELLIPSE_DEFAULT_SATURATION
|
||||
#define FORCE_ELLIPSE_DEFAULT_WIDTH FEEL_ELLIPSE_DEFAULT_WIDTH
|
||||
#define FORCE_ELLIPSE_HEIGHT_AUTO FEEL_ELLIPSE_HEIGHT_AUTO
|
||||
#define FORCE_ELLIPSE_DEFAULT_HEIGHT FEEL_ELLIPSE_DEFAULT_HEIGHT
|
||||
#define FORCE_ELLIPSE_WALL_WIDTH_AUTO FEEL_ELLIPSE_WALL_WIDTH_AUTO
|
||||
#define FORCE_ELLIPSE_DEFAULT_WALL_WIDTH FEEL_ELLIPSE_DEFAULT_WALL_WIDTH
|
||||
#define FORCE_ELLIPSE_DEFAULT_STIFFNESS_MASK FEEL_ELLIPSE_DEFAULT_STIFFNESS_MASK
|
||||
#define FORCE_ELLIPSE_DEFAULT_CLIPPING_MASK FEEL_ELLIPSE_DEFAULT_CLIPPING_MASK
|
||||
|
||||
#define FORCE_ELLIPSE_DEFAULT_CENTER_POINT FEEL_ELLIPSE_DEFAULT_CENTER_POINT
|
||||
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelEllipse
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelEllipse : public CFeelEffect
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESCTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelEllipse();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelEllipse();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
POINT pntCenter,
|
||||
DWORD dwWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwHeight = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lStiffness = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwWallWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwStiffnessMask = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwClippingMask = FEEL_EFFECT_DONT_CHANGE,
|
||||
CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
LPCRECT pRectOutside,
|
||||
LONG lStiffness = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwWallWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwStiffnessMask = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwClippingMask = FEEL_EFFECT_DONT_CHANGE,
|
||||
CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
SetRect(
|
||||
LPCRECT pRect
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
SetCenter(
|
||||
POINT pntCenter
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
SetCenter(
|
||||
LONG x,
|
||||
LONG y
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwWidth = FEEL_ELLIPSE_DEFAULT_WIDTH,
|
||||
DWORD dwHeight = FEEL_ELLIPSE_DEFAULT_HEIGHT,
|
||||
LONG lStiffness = FEEL_ELLIPSE_DEFAULT_STIFFNESS,
|
||||
DWORD dwWallWidth = FEEL_ELLIPSE_DEFAULT_WALL_WIDTH,
|
||||
DWORD dwSaturation = FEEL_ELLIPSE_DEFAULT_SATURATION,
|
||||
DWORD dwStiffnessMask = FEEL_ELLIPSE_DEFAULT_STIFFNESS_MASK,
|
||||
DWORD dwClippingMask = FEEL_ELLIPSE_DEFAULT_CLIPPING_MASK,
|
||||
POINT pntCenter = FEEL_ELLIPSE_DEFAULT_CENTER_POINT,
|
||||
CFeelEffect* pInsideEffect = NULL
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
LPCRECT pRectOutside,
|
||||
LONG lStiffness = FEEL_ELLIPSE_DEFAULT_STIFFNESS,
|
||||
DWORD dwWallWidth = FEEL_ELLIPSE_DEFAULT_WALL_WIDTH,
|
||||
DWORD dwSaturation = FEEL_ELLIPSE_DEFAULT_SATURATION,
|
||||
DWORD dwStiffnessMask = FEEL_ELLIPSE_DEFAULT_STIFFNESS_MASK,
|
||||
DWORD dwClippingMask = FEEL_ELLIPSE_DEFAULT_CLIPPING_MASK,
|
||||
CFeelEffect* pInsideEffect = NULL
|
||||
);
|
||||
|
||||
|
||||
virtual BOOL
|
||||
#ifdef FFC_START_DELAY
|
||||
StartNow(
|
||||
#else
|
||||
Start(
|
||||
#endif
|
||||
DWORD dwFlags = 0
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
BOOL
|
||||
set_parameters(
|
||||
LPCRECT pRectOutside,
|
||||
LONG lStiffness,
|
||||
DWORD dwWallWidth,
|
||||
DWORD dwSaturation,
|
||||
DWORD dwStiffnessMask,
|
||||
DWORD dwClippingMask,
|
||||
CFeelEffect* pInsideEffect
|
||||
);
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
FEELIT_ELLIPSE m_ellipse;
|
||||
BOOL m_bUseMousePosAtStart;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelEllipse::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Ellipse);
|
||||
}
|
||||
|
||||
#endif // !defined(AFX_FEELELLIPSE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,268 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelEnclosure.h
|
||||
|
||||
PURPOSE: Base Enclosure Class for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 10/29/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELENCLOSURE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELENCLOSURE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelEffect.h"
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
|
||||
#define FEEL_ENCLOSURE_DEFAULT_STIFFNESS 5000
|
||||
#define FEEL_ENCLOSURE_DEFAULT_SATURATION 10000
|
||||
#define FEEL_ENCLOSURE_DEFAULT_WIDTH 10
|
||||
#define FEEL_ENCLOSURE_HEIGHT_AUTO MAXDWORD
|
||||
#define FEEL_ENCLOSURE_DEFAULT_HEIGHT FEEL_ENCLOSURE_HEIGHT_AUTO
|
||||
#define FEEL_ENCLOSURE_WALL_WIDTH_AUTO MAXDWORD
|
||||
#define FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH FEEL_ENCLOSURE_WALL_WIDTH_AUTO
|
||||
#define FEEL_ENCLOSURE_DEFAULT_STIFFNESS_MASK FEELIT_FSTIFF_ANYWALL
|
||||
#define FEEL_ENCLOSURE_DEFAULT_CLIPPING_MASK FEELIT_FCLIP_NONE
|
||||
|
||||
#define FEEL_ENCLOSURE_DEFAULT_CENTER_POINT FEEL_EFFECT_MOUSE_POS_AT_START
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_ENCLOSURE_DEFAULT_STIFFNESS FEEL_ENCLOSURE_DEFAULT_STIFFNESS
|
||||
#define FORCE_ENCLOSURE_DEFAULT_SATURATION FEEL_ENCLOSURE_DEFAULT_SATURATION
|
||||
#define FORCE_ENCLOSURE_DEFAULT_WIDTH FEEL_ENCLOSURE_DEFAULT_WIDTH
|
||||
#define FORCE_ENCLOSURE_HEIGHT_AUTO FEEL_ENCLOSURE_HEIGHT_AUTO
|
||||
#define FORCE_ENCLOSURE_DEFAULT_HEIGHT FEEL_ENCLOSURE_DEFAULT_HEIGHT
|
||||
#define FORCE_ENCLOSURE_WALL_WIDTH_AUTO FEEL_ENCLOSURE_WALL_WIDTH_AUTO
|
||||
#define FORCE_ENCLOSURE_DEFAULT_WALL_WIDTH FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH
|
||||
#define FORCE_ENCLOSURE_DEFAULT_STIFFNESS_MASK FEEL_ENCLOSURE_DEFAULT_STIFFNESS_MASK
|
||||
#define FORCE_ENCLOSURE_DEFAULT_CLIPPING_MASK FEEL_ENCLOSURE_DEFAULT_CLIPPING_MASK
|
||||
|
||||
#define FORCE_ENCLOSURE_DEFAULT_CENTER_POINT FEEL_ENCLOSURE_DEFAULT_CENTER_POINT
|
||||
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelEnclosure
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelEnclosure : public CFeelEffect
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESCTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelEnclosure();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelEnclosure();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
POINT pntCenter,
|
||||
DWORD dwWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwHeight = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lTopAndBottomWallStiffness = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lLeftAndRightWallStiffness = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwTopAndBottomWallWallWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwLeftAndRightWallWallWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwTopAndBottomWallSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwLeftAndRightWallSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwStiffnessMask = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwClippingMask = FEEL_EFFECT_DONT_CHANGE,
|
||||
CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
LPCRECT pRectOutside,
|
||||
LONG lTopAndBottomWallStiffness = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lLeftAndRightWallStiffness = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwTopAndBottomWallWallWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwLeftAndRightWallWallWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwTopAndBottomWallSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwLeftAndRightWallSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwStiffnessMask = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwClippingMask = FEEL_EFFECT_DONT_CHANGE,
|
||||
CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
SetRect(
|
||||
LPCRECT pRect
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
SetCenter(
|
||||
POINT pntCenter
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
SetCenter(
|
||||
LONG x,
|
||||
LONG y
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwWidth = FEEL_ENCLOSURE_DEFAULT_WIDTH,
|
||||
DWORD dwHeight = FEEL_ENCLOSURE_DEFAULT_HEIGHT,
|
||||
LONG lTopAndBottomWallStiffness = FEEL_ENCLOSURE_DEFAULT_STIFFNESS,
|
||||
LONG lLeftAndRightWallStiffness = FEEL_ENCLOSURE_DEFAULT_STIFFNESS,
|
||||
DWORD dwTopAndBottomWallWallWidth = FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH,
|
||||
DWORD dwLeftAndRightWallWallWidth = FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH,
|
||||
DWORD dwTopAndBottomWallSaturation = FEEL_ENCLOSURE_DEFAULT_SATURATION,
|
||||
DWORD dwLeftAndRightWallSaturation = FEEL_ENCLOSURE_DEFAULT_SATURATION,
|
||||
DWORD dwStiffnessMask = FEEL_ENCLOSURE_DEFAULT_STIFFNESS_MASK,
|
||||
DWORD dwClippingMask = FEEL_ENCLOSURE_DEFAULT_CLIPPING_MASK,
|
||||
POINT pntCenter = FEEL_ENCLOSURE_DEFAULT_CENTER_POINT,
|
||||
CFeelEffect* pInsideEffect = NULL
|
||||
);
|
||||
|
||||
|
||||
BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
LPCRECT pRectOutside,
|
||||
LONG lTopAndBottomWallStiffness = FEEL_ENCLOSURE_DEFAULT_STIFFNESS,
|
||||
LONG lLeftAndRightWallStiffness = FEEL_ENCLOSURE_DEFAULT_STIFFNESS,
|
||||
DWORD dwTopAndBottomWallWallWidth = FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH,
|
||||
DWORD dwLeftAndRightWallWallWidth = FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH,
|
||||
DWORD dwTopAndBottomWallSaturation = FEEL_ENCLOSURE_DEFAULT_SATURATION,
|
||||
DWORD dwLeftAndRightWallSaturation = FEEL_ENCLOSURE_DEFAULT_SATURATION,
|
||||
DWORD dwStiffnessMask = FEEL_ENCLOSURE_DEFAULT_STIFFNESS_MASK,
|
||||
DWORD dwClippingMask = FEEL_ENCLOSURE_DEFAULT_CLIPPING_MASK,
|
||||
CFeelEffect* pInsideEffect = NULL
|
||||
);
|
||||
|
||||
|
||||
virtual BOOL
|
||||
#ifdef FFC_START_DELAY
|
||||
StartNow(
|
||||
#else
|
||||
Start(
|
||||
#endif
|
||||
DWORD dwFlags = 0
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
BOOL
|
||||
set_parameters(
|
||||
LPCRECT pRectOutside,
|
||||
LONG lTopAndBottomWallStiffness,
|
||||
LONG lLeftAndRightWallStiffness,
|
||||
DWORD dwTopAndBottomWallWallWidth,
|
||||
DWORD dwLeftAndRightWallWallWidth,
|
||||
DWORD dwTopAndBottomWallSaturation,
|
||||
DWORD dwLeftAndRightWallSaturation,
|
||||
DWORD dwStiffnessMask,
|
||||
DWORD dwClippingMask,
|
||||
CFeelEffect* pInsideEffect
|
||||
);
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
FEELIT_ENCLOSURE m_enclosure;
|
||||
BOOL m_bUseMousePosAtStart;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelEnclosure::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Enclosure);
|
||||
}
|
||||
|
||||
#endif // !defined(AFX_FEELENCLOSURE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,172 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelFriction.h
|
||||
|
||||
PURPOSE: Feelit API Friction Effect Class
|
||||
|
||||
STARTED: 12/29/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELFriction_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELFriction_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include "FeelCondition.h"
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
#define FEEL_FRICTION_DEFAULT_COEFFICIENT 2500
|
||||
#define FEEL_FRICTION_DEFAULT_MIN_VELOCITY 0
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_FRICTION_DEFAULT_COEFFICIENT FEEL_FRICTION_DEFAULT_COEFFICIENT
|
||||
#define FORCE_FRICTION_DEFAULT_MIN_VELOCITY FEEL_FRICTION_DEFAULT_MIN_VELOCITY
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelFriction
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelFriction : public CFeelCondition
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelFriction();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelFriction();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
DWORD dwCoefficient,
|
||||
DWORD dwMinVelocity = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParametersPolar(
|
||||
DWORD dwCoefficient,
|
||||
DWORD dwMinVelocity,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwCoefficient = FEEL_FRICTION_DEFAULT_COEFFICIENT,
|
||||
DWORD dwMinVelocity = FEEL_FRICTION_DEFAULT_MIN_VELOCITY,
|
||||
DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH,
|
||||
LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X,
|
||||
LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y
|
||||
);
|
||||
|
||||
virtual BOOL
|
||||
InitializePolar(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwCoefficient,
|
||||
DWORD dwMinVelocity,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelFriction::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Friction);
|
||||
}
|
||||
|
||||
|
||||
#endif // !defined(AFX_FEELFriction_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,171 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelGrid.h
|
||||
|
||||
PURPOSE: Feelit API Grid Effect Class
|
||||
|
||||
STARTED: 12/11/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELGrid_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELGrid_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include "FeelCondition.h"
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
#define FEEL_GRID_DEFAULT_HORIZ_OFFSET 0
|
||||
#define FEEL_GRID_DEFAULT_VERT_OFFSET 0
|
||||
#define FEEL_GRID_DEFAULT_HORIZ_SPACING 100
|
||||
#define FEEL_GRID_DEFAULT_VERT_SPACING 100
|
||||
#define FEEL_GRID_DEFAULT_NODE_STRENGTH 5000
|
||||
#define FEEL_GRID_DEFAULT_NODE_SATURATION 10000
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_GRID_DEFAULT_HORIZ_OFFSET FEEL_GRID_DEFAULT_HORIZ_OFFSET
|
||||
#define FORCE_GRID_DEFAULT_VERT_OFFSET FEEL_GRID_DEFAULT_VERT_OFFSET
|
||||
#define FORCE_GRID_DEFAULT_HORIZ_SPACING FEEL_GRID_DEFAULT_HORIZ_SPACING
|
||||
#define FORCE_GRID_DEFAULT_VERT_SPACING FEEL_GRID_DEFAULT_VERT_SPACING
|
||||
#define FORCE_GRID_DEFAULT_NODE_STRENGTH FEEL_GRID_DEFAULT_NODE_STRENGTH
|
||||
#define FORCE_GRID_DEFAULT_NODE_SATURATION FEEL_GRID_DEFAULT_NODE_SATURATION
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelGrid
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelGrid : public CFeelCondition
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelGrid();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelGrid();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
DWORD dwHorizSpacing,
|
||||
DWORD dwVertSpacing,
|
||||
LONG lHorizNodeStrength = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lVertNodeStrength = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwHorizOffset = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwVertOffset = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwHorizNodeSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwVertNodeSaturation = FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwHorizSpacing = FEEL_GRID_DEFAULT_HORIZ_SPACING,
|
||||
DWORD dwVertSpacing = FEEL_GRID_DEFAULT_VERT_SPACING,
|
||||
LONG lHorizNodeStrength = FEEL_GRID_DEFAULT_NODE_STRENGTH,
|
||||
LONG lVertNodeStrength = FEEL_GRID_DEFAULT_NODE_STRENGTH,
|
||||
DWORD dwHorizOffset = FEEL_GRID_DEFAULT_HORIZ_OFFSET,
|
||||
DWORD dwVertOffset = FEEL_GRID_DEFAULT_VERT_OFFSET,
|
||||
DWORD dwHorizNodeSaturation = FEEL_GRID_DEFAULT_NODE_SATURATION,
|
||||
DWORD dwVertNodeSaturation = FEEL_GRID_DEFAULT_NODE_SATURATION
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelGrid::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Grid);
|
||||
}
|
||||
|
||||
#endif // !defined(AFX_FEELGrid_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,178 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelInertia.h
|
||||
|
||||
PURPOSE: Feelit API Inertia Effect Class
|
||||
|
||||
STARTED: 12/29/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELInertia_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELInertia_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include "FeelCondition.h"
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
#define FEEL_INERTIA_DEFAULT_COEFFICIENT 2500
|
||||
#define FEEL_INERTIA_DEFAULT_SATURATION 10000
|
||||
#define FEEL_INERTIA_DEFAULT_MIN_ACCELERATION 0
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_INERTIA_DEFAULT_COEFFICIENT FEEL_INERTIA_DEFAULT_COEFFICIENT
|
||||
#define FORCE_INERTIA_DEFAULT_SATURATION FEEL_INERTIA_DEFAULT_SATURATION
|
||||
#define FORCE_INERTIA_DEFAULT_MIN_ACCELERATION FEEL_INERTIA_DEFAULT_MIN_ACCELERATION
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelInertia
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelInertia : public CFeelCondition
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelInertia();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelInertia();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
DWORD dwCoefficient,
|
||||
DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwMinAcceleration = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParametersPolar(
|
||||
DWORD dwCoefficient,
|
||||
DWORD dwSaturation,
|
||||
DWORD dwMinAcceleration,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwCoefficient = FEEL_INERTIA_DEFAULT_COEFFICIENT,
|
||||
DWORD dwSaturation = FEEL_INERTIA_DEFAULT_SATURATION,
|
||||
DWORD dwMinAcceleration = FEEL_INERTIA_DEFAULT_MIN_ACCELERATION,
|
||||
DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH,
|
||||
LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X,
|
||||
LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y
|
||||
);
|
||||
|
||||
virtual BOOL
|
||||
InitializePolar(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwCoefficient,
|
||||
DWORD dwSaturation,
|
||||
DWORD dwMinAcceleration,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelInertia::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Inertia);
|
||||
}
|
||||
|
||||
|
||||
#endif // !defined(AFX_FEELInertia_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
File diff suppressed because it is too large
Load diff
|
@ -1,247 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1999 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FEELitIFR.h
|
||||
|
||||
PURPOSE: Input/Output for IFR Files, FEELit version
|
||||
|
||||
STARTED:
|
||||
|
||||
NOTES/REVISIONS:
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#if !defined( _FEELIT2_H_)
|
||||
#define _FEELIT2_H_
|
||||
|
||||
#ifndef __FEELITAPI_INCLUDED__
|
||||
#error include 'dinput.h' before including this file for structures.
|
||||
#endif /* !__DINPUT_INCLUDED__ */
|
||||
|
||||
#define IFRAPI __stdcall
|
||||
|
||||
#if !defined(_FFCDLL_)
|
||||
#define DLLAPI __declspec(dllimport)
|
||||
#else
|
||||
#define DLLAPI __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#if defined __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
** CONSTANTS
|
||||
*/
|
||||
|
||||
/*
|
||||
** RT_FEELIT - Resource type for IFR projects stored as resources.
|
||||
** This is the resource type looked for by IFLoadProjectResource().
|
||||
*/
|
||||
#define RT_FEELIT ((LPCSTR)"FEELIT")
|
||||
|
||||
|
||||
/*
|
||||
** TYPES/STRUCTURES
|
||||
*/
|
||||
|
||||
/*
|
||||
** HIFRPROJECT - used to identify a loaded project as a whole.
|
||||
** individual objects within a project are uniquely referenced by name.
|
||||
** Created by the IFLoadProject*() functions and released by IFReleaseProject().
|
||||
*/
|
||||
typedef LPVOID HIFRPROJECT;
|
||||
|
||||
/*
|
||||
** IFREffect - contains the information needed to create a DI effect
|
||||
** using IDirectInputEffect::CreateEffect(). An array of pointers to these
|
||||
** structures is allocated and returned by IFCreateEffectStructs().
|
||||
*/
|
||||
typedef struct {
|
||||
GUID guid;
|
||||
LPFEELIT_EFFECT lpDIEffect;
|
||||
} IFREffect;
|
||||
|
||||
|
||||
/*
|
||||
** FUNCTION DECLARATIONS
|
||||
*/
|
||||
|
||||
/*
|
||||
** IFLoadProjectResource() - Load a project from a resource.
|
||||
** hRsrcModule - handle of the module containing the project definition resource.
|
||||
** pRsrcName - name or MAKEINTRESOURCE(id) identifier of resource to load.
|
||||
** pDevice - device for which the project is being loaded. If NULL,
|
||||
** effects will be created generically, and IFCreateEffects() will fail.
|
||||
** Returns an identifier for the loaded project, or NULL if unsuccessful.
|
||||
*/
|
||||
DLLAPI
|
||||
HIFRPROJECT
|
||||
IFRAPI
|
||||
IFRLoadProjectResource(
|
||||
HMODULE hRsrcModule,
|
||||
LPCSTR pRsrcName,
|
||||
LPIFEELIT_DEVICE pDevice );
|
||||
|
||||
/*
|
||||
** IFLoadProjectPointer() - Load a project from a pointer.
|
||||
** pProject - points to a project definition.
|
||||
** pDevice - device for which the project is being loaded. If NULL,
|
||||
** effects will be created generically, and IFCreateEffects() will fail.
|
||||
** Returns an identifier for the loaded project, or NULL if unsuccessful.
|
||||
*/
|
||||
DLLAPI
|
||||
HIFRPROJECT
|
||||
IFRAPI
|
||||
IFRLoadProjectPointer(
|
||||
LPVOID pProject,
|
||||
LPIFEELIT_DEVICE pDevice );
|
||||
|
||||
/*
|
||||
** IFLoadProjectFile() - Load a project from a file.
|
||||
** pProjectFileName - points to a project file name.
|
||||
** pDevice - device for which the project is being loaded. If NULL,
|
||||
** effects will be created generically, and IFCreateEffects() will fail.
|
||||
** Returns an identifier for the loaded project, or NULL if unsuccessful.
|
||||
*/
|
||||
DLLAPI
|
||||
HIFRPROJECT
|
||||
IFRAPI
|
||||
IFRLoadProjectFile(
|
||||
LPCSTR pProjectFileName,
|
||||
LPIFEELIT_DEVICE pDevice );
|
||||
|
||||
/*
|
||||
** IFLoadProjectObjectPointer() - Load a project from a pointer to a single
|
||||
** object definition (usually used only by the editor).
|
||||
** pObject - points to an object definition.
|
||||
** pDevice - device for which the project is being loaded. If NULL,
|
||||
** effects will be created generically, and IFCreateEffects() will fail.
|
||||
** Returns an identifier for the loaded project, or NULL if unsuccessful.
|
||||
*/
|
||||
DLLAPI
|
||||
HIFRPROJECT
|
||||
IFRAPI
|
||||
IFRLoadProjectObjectPointer(
|
||||
LPVOID pObject,
|
||||
LPIFEELIT_DEVICE pDevice );
|
||||
|
||||
/*
|
||||
** IFReleaseProject() - Release a loaded project.
|
||||
** hProject - identifies the project to be released.
|
||||
** Returns TRUE if the project is released, FALSE if it is an invalid project.
|
||||
*/
|
||||
DLLAPI
|
||||
BOOL
|
||||
IFRAPI
|
||||
IFRReleaseProject(
|
||||
HIFRPROJECT hProject );
|
||||
|
||||
/*
|
||||
** IFCreateEffectStructs() - Create IFREffects for a named effect.
|
||||
** hProject - identifies the project containing the object.
|
||||
** pObjectName - name of the object for which to create structures.
|
||||
** pNumEffects - if not NULL will be set to a count of the IFREffect
|
||||
** structures in the array (not including the terminating NULL pointer.)
|
||||
** Returns a pointer to the allocated array of pointers to IFREffect
|
||||
** structures. The array is terminated with a NULL pointer. If the
|
||||
** function fails, a NULL pointer is returned.
|
||||
*/
|
||||
DLLAPI
|
||||
IFREffect **
|
||||
IFRAPI
|
||||
IFRCreateEffectStructs(
|
||||
HIFRPROJECT hProject,
|
||||
LPCSTR pObjectName,
|
||||
int *pNumEffects );
|
||||
|
||||
DLLAPI
|
||||
IFREffect **
|
||||
IFRAPI
|
||||
IFRCreateEffectStructsByIndex(
|
||||
HIFRPROJECT hProject,
|
||||
int nObjectIndex,
|
||||
int *pNumEffects );
|
||||
|
||||
DLLAPI
|
||||
LPCSTR
|
||||
IFRAPI
|
||||
IFRGetObjectNameByIndex(
|
||||
HIFRPROJECT hProject,
|
||||
int nObjectIndex );
|
||||
|
||||
/*
|
||||
** IFReleaseEffectStructs() - Release an array of IFREffects.
|
||||
** hProject - identifies the project for which the effects were created.
|
||||
** pEffects - points to the array of IFREffect pointers to be released.
|
||||
** Returns TRUE if the array is released, FALSE if it is an invalid array.
|
||||
*/
|
||||
DLLAPI
|
||||
BOOL
|
||||
IFRAPI
|
||||
IFRReleaseEffectStructs(
|
||||
HIFRPROJECT hProject,
|
||||
IFREffect **pEffects );
|
||||
|
||||
/*
|
||||
** IFCreateEffects() - Creates the DirectInput effects using
|
||||
** IDirectInput::CreateEffect().
|
||||
** hProject - identifies the project containing the object.
|
||||
** pObjectName - name of the object for which to create effects.
|
||||
** pNumEffects - if not NULL will be set to a count of the IDirectInputEffect
|
||||
** pointers in the array (not including the terminating NULL pointer.)
|
||||
** Returns a pointer to the allocated array of pointers to IDirectInputEffects.
|
||||
** The array is terminated with a NULL pointer. If the function fails,
|
||||
** a NULL pointer is returned.
|
||||
*/
|
||||
DLLAPI
|
||||
LPIFEELIT_EFFECT *
|
||||
IFRAPI
|
||||
IFRCreateEffects(
|
||||
HIFRPROJECT hProject,
|
||||
LPCSTR pObjectName,
|
||||
int *pNumEffects );
|
||||
|
||||
/*
|
||||
** IFReleaseEffects() - Releases an array of IDirectInputEffect structures.
|
||||
** hProject - identifies the project for which the effects were created.
|
||||
** pEffects - points to the array if IDirectInputEffect pointers to be released.
|
||||
** Returns TRUE if the array is released, FALSE if it is an invalid array.
|
||||
*/
|
||||
DLLAPI
|
||||
BOOL
|
||||
IFRAPI
|
||||
IFRReleaseEffects(
|
||||
HIFRPROJECT hProject,
|
||||
LPIFEELIT_EFFECT *pEffects );
|
||||
|
||||
DLLAPI
|
||||
BOOL
|
||||
IFRAPI
|
||||
DllMain(
|
||||
HINSTANCE hInstDLL,
|
||||
DWORD fdwReason,
|
||||
LPVOID lpvReserved );
|
||||
|
||||
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* !IForce2_h */
|
|
@ -1,143 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelMouse.h
|
||||
|
||||
PURPOSE: Abstraction of Feelit mouse device
|
||||
|
||||
STARTED: 10/10/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef FeelMouse_h
|
||||
#define FeelMouse_h
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelDevice.h"
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelMouse
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelMouse : public CFeelDevice
|
||||
{
|
||||
|
||||
//
|
||||
// CONSTRUCTOR/DESCTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelMouse();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelMouse();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual LPIFEEL_API
|
||||
GetAPI()
|
||||
{ return m_piApi; }
|
||||
|
||||
virtual LPIFEEL_DEVICE
|
||||
GetDevice()
|
||||
{ return m_piDevice; }
|
||||
|
||||
BOOL
|
||||
HaveForceFeelitMouse()
|
||||
{ return m_piDevice != NULL; }
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
BOOL
|
||||
Initialize(
|
||||
HANDLE hinstApp,
|
||||
HANDLE hwndApp,
|
||||
DWORD dwCooperativeFlag = FEELIT_FCOOPLEVEL_FOREGROUND
|
||||
);
|
||||
|
||||
virtual BOOL
|
||||
ChangeScreenResolution(
|
||||
BOOL bAutoSet,
|
||||
DWORD dwXScreenSize = 0,
|
||||
DWORD dwYScreenSize = 0
|
||||
);
|
||||
|
||||
// Another syntax for SwitchToAbsoluteMode.
|
||||
// The default is Absolute mode. Call only to switch to Relative mode or
|
||||
// to switch back to Absolute mode.
|
||||
virtual BOOL
|
||||
SwitchToAbsoluteMode(
|
||||
BOOL bAbsMode
|
||||
);
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
virtual void
|
||||
reset();
|
||||
|
||||
virtual BOOL
|
||||
prepare_device();
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
LPIFEEL_API m_piApi;
|
||||
LPIFEEL_DEVICE m_piDevice;
|
||||
};
|
||||
|
||||
#endif // ForceFeelitMouse_h
|
|
@ -1,227 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelPeriodic.h
|
||||
|
||||
PURPOSE: Base Periodic Class for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 11/03/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELPERIODIC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELPERIODIC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelEffect.h"
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
#define FEEL_PERIODIC_DEFAULT_DURATION 1000 // Milliseconds
|
||||
#define FEEL_PERIODIC_DEFAULT_MAGNITUDE 5000
|
||||
#define FEEL_PERIODIC_DEFAULT_PERIOD 100 // Milliseconds
|
||||
#define FEEL_PERIODIC_DEFAULT_OFFSET 0
|
||||
#define FEEL_PERIODIC_DEFAULT_PHASE 0 // Degrees
|
||||
#define FEEL_PERIODIC_DEFAULT_DIRECTION_X 1 // Pixels
|
||||
#define FEEL_PERIODIC_DEFAULT_DIRECTION_Y 0 // Pixels
|
||||
#define FEEL_PERIODIC_DEFAULT_ANGLE 9000 // 100ths of degrees
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_PERIODIC_DEFAULT_DURATION FEEL_PERIODIC_DEFAULT_DURATION
|
||||
#define FORCE_PERIODIC_DEFAULT_MAGNITUDE FEEL_PERIODIC_DEFAULT_MAGNITUDE
|
||||
#define FORCE_PERIODIC_DEFAULT_PERIOD FEEL_PERIODIC_DEFAULT_PERIOD
|
||||
#define FORCE_PERIODIC_DEFAULT_OFFSET FEEL_PERIODIC_DEFAULT_OFFSET
|
||||
#define FORCE_PERIODIC_DEFAULT_PHASE FEEL_PERIODIC_DEFAULT_PHASE
|
||||
#define FORCE_PERIODIC_DEFAULT_DIRECTION_X FEEL_PERIODIC_DEFAULT_DIRECTION_X
|
||||
#define FORCE_PERIODIC_DEFAULT_DIRECTION_Y FEEL_PERIODIC_DEFAULT_DIRECTION_Y
|
||||
#define FORCE_PERIODIC_DEFAULT_ANGLE FEEL_PERIODIC_DEFAULT_ANGLE
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelPeriodic
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelPeriodic : public CFeelEffect
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
// You may use this form if you will immediately initialize it
|
||||
// from an IFR file...
|
||||
CFeelPeriodic();
|
||||
|
||||
// Otherwise use this form...
|
||||
CFeelPeriodic(
|
||||
const GUID& rguidEffect
|
||||
);
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelPeriodic();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
DWORD dwMagnitude,
|
||||
DWORD dwPeriod = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lOffset = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwPhase = FEEL_EFFECT_DONT_CHANGE,
|
||||
LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParametersPolar(
|
||||
DWORD dwMagnitude,
|
||||
DWORD dwPeriod = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lAngle = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lOffset = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwPhase = FEEL_EFFECT_DONT_CHANGE,
|
||||
LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwMagnitude = FEEL_PERIODIC_DEFAULT_MAGNITUDE,
|
||||
DWORD dwPeriod = FEEL_PERIODIC_DEFAULT_PERIOD,
|
||||
DWORD dwDuration = FEEL_PERIODIC_DEFAULT_DURATION,
|
||||
LONG lDirectionX = FEEL_PERIODIC_DEFAULT_DIRECTION_X,
|
||||
LONG lDirectionY = FEEL_PERIODIC_DEFAULT_DIRECTION_Y,
|
||||
LONG lOffset = FEEL_PERIODIC_DEFAULT_OFFSET,
|
||||
DWORD dwPhase = FEEL_PERIODIC_DEFAULT_PHASE,
|
||||
LPFEEL_ENVELOPE pEnvelope = NULL
|
||||
);
|
||||
|
||||
virtual BOOL
|
||||
InitializePolar(
|
||||
CFeelDevice* pDevice,
|
||||
DWORD dwMagnitude = FEEL_PERIODIC_DEFAULT_MAGNITUDE,
|
||||
DWORD dwPeriod = FEEL_PERIODIC_DEFAULT_PERIOD,
|
||||
DWORD dwDuration = FEEL_PERIODIC_DEFAULT_DURATION,
|
||||
LONG lAngle = FEEL_PERIODIC_DEFAULT_ANGLE,
|
||||
LONG lOffset = FEEL_PERIODIC_DEFAULT_OFFSET,
|
||||
DWORD dwPhase = FEEL_PERIODIC_DEFAULT_PHASE,
|
||||
LPFEEL_ENVELOPE pEnvelope = NULL
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
BOOL
|
||||
set_parameters(
|
||||
DWORD dwfCoordinates,
|
||||
LONG lDirection0,
|
||||
LONG lDirection1,
|
||||
DWORD dwDuration,
|
||||
DWORD dwMagnitude,
|
||||
DWORD dwPeriod,
|
||||
LONG lOffset,
|
||||
DWORD dwPhase,
|
||||
LPFEEL_ENVELOPE pEnvelope
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
FEEL_PERIODIC m_Periodic;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelPeriodic::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Sine) ||
|
||||
IsEqualGUID(guid, GUID_Feel_Square) ||
|
||||
IsEqualGUID(guid, GUID_Feel_Triangle) ||
|
||||
IsEqualGUID(guid, GUID_Feel_SawtoothUp) ||
|
||||
IsEqualGUID(guid, GUID_Feel_SawtoothDown);
|
||||
}
|
||||
|
||||
#endif // !defined(AFX_FEELPERIODIC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,302 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1999 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelProjects.h
|
||||
|
||||
PURPOSE: CFeelProject
|
||||
Manages a set of forces in a project.
|
||||
There will be a project for each opened IFR file.
|
||||
CFeelProjects
|
||||
Manages a set of projects
|
||||
|
||||
STARTED: 2/22/99 by Jeff Mallett
|
||||
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __FEEL_PROJECTS_H
|
||||
#define __FEEL_PROJECTS_H
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
|
||||
#include "FFCErrors.h"
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelDevice.h"
|
||||
#include "FeelCompoundEffect.h"
|
||||
|
||||
class CFeelProjects;
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelProject
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelProject
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
CFeelProject() :
|
||||
m_hProj(NULL), m_pCreatedEffects(NULL),
|
||||
m_pNext(NULL), m_pDevice(NULL)
|
||||
{ }
|
||||
|
||||
~CFeelProject();
|
||||
|
||||
void
|
||||
Close();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
CFeelDevice*
|
||||
GetDevice() const
|
||||
{ return m_pDevice; }
|
||||
|
||||
BOOL
|
||||
GetIsOpen() const
|
||||
{ return m_hProj != NULL; }
|
||||
|
||||
CFeelCompoundEffect *
|
||||
GetCreatedEffect(
|
||||
LPCSTR lpszEffectName
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
BOOL
|
||||
Start(
|
||||
LPCSTR lpszEffectName = NULL,
|
||||
DWORD dwIterations = 1,
|
||||
DWORD dwFlags = 0,
|
||||
CFeelDevice* pDevice = NULL
|
||||
);
|
||||
|
||||
BOOL
|
||||
Stop(
|
||||
LPCSTR lpszEffectName = NULL
|
||||
);
|
||||
|
||||
BOOL
|
||||
OpenFile(
|
||||
LPCSTR lpszFilePath,
|
||||
CFeelDevice *pDevice
|
||||
);
|
||||
|
||||
LoadProjectObjectPointer(
|
||||
BYTE *pMem,
|
||||
CFeelDevice *pDevice
|
||||
);
|
||||
|
||||
CFeelCompoundEffect *
|
||||
CreateEffect(
|
||||
LPCSTR lpszEffectName,
|
||||
CFeelDevice* pDevice = NULL
|
||||
);
|
||||
|
||||
CFeelCompoundEffect *
|
||||
CreateEffectByIndex(
|
||||
int nEffectIndex,
|
||||
CFeelDevice* pDevice = NULL
|
||||
);
|
||||
|
||||
CFeelCompoundEffect *
|
||||
AddEffect(
|
||||
LPCSTR lpszEffectName,
|
||||
GENERIC_EFFECT_PTR pObject
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
void
|
||||
set_next(
|
||||
CFeelProject *pNext
|
||||
)
|
||||
{ m_pNext = pNext; }
|
||||
|
||||
CFeelProject *
|
||||
get_next() const
|
||||
{ return m_pNext; }
|
||||
|
||||
void
|
||||
append_effect_to_list(
|
||||
CFeelCompoundEffect* pEffect
|
||||
);
|
||||
|
||||
IFREffect **
|
||||
create_effect_structs(
|
||||
LPCSTR lpszEffectName,
|
||||
int &nEff
|
||||
);
|
||||
|
||||
IFREffect **
|
||||
create_effect_structs_by_index(
|
||||
int nEffectIndex,
|
||||
int &nEff
|
||||
);
|
||||
|
||||
BOOL
|
||||
release_effect_structs(
|
||||
IFREffect **hEffects
|
||||
);
|
||||
|
||||
//
|
||||
// FRIENDS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
friend BOOL
|
||||
CFeelEffect::InitializeFromProject(
|
||||
CFeelProject &project,
|
||||
LPCSTR lpszEffectName,
|
||||
CFeelDevice* pDevice /* = NULL */
|
||||
);
|
||||
|
||||
friend class CFeelProjects;
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
HIFRPROJECT m_hProj;
|
||||
CFeelCompoundEffect* m_pCreatedEffects;
|
||||
CFeelDevice* m_pDevice;
|
||||
|
||||
private:
|
||||
|
||||
CFeelProject* m_pNext;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelProjects
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelProjects
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
CFeelProjects() : m_pProjects(NULL) { }
|
||||
|
||||
~CFeelProjects();
|
||||
|
||||
void
|
||||
Close();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
CFeelProject *
|
||||
GetProject(
|
||||
int index = 0
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
BOOL
|
||||
Stop();
|
||||
|
||||
long
|
||||
OpenFile(
|
||||
LPCSTR lpszFilePath,
|
||||
CFeelDevice *pDevice
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
protected:
|
||||
|
||||
CFeelProject *m_pProjects;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // __FEEL_PROJECTS_H
|
|
@ -1,194 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelRamp.h
|
||||
|
||||
PURPOSE: Base Ramp Force Class for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 12/11/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELRAMP_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELRAMP_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelEffect.h"
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
#define FEEL_RAMP_DEFAULT_DURATION 1000 // Milliseconds
|
||||
#define FEEL_RAMP_DEFAULT_MAGNITUDE_START 0
|
||||
#define FEEL_RAMP_DEFAULT_MAGNITUDE_END 10000
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_RAMP_DEFAULT_DURATION FEEL_RAMP_DEFAULT_DURATION
|
||||
#define FORCE_RAMP_DEFAULT_MAGNITUDE_START FEEL_RAMP_DEFAULT_MAGNITUDE_START
|
||||
#define FORCE_RAMP_DEFAULT_MAGNITUDE_END FEEL_RAMP_DEFAULT_MAGNITUDE_END
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelRamp
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelRamp : public CFeelEffect
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelRamp();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelRamp();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
LONG lDirectionX,
|
||||
LONG lDirectionY,
|
||||
DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lMagStart = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lMagEnd = FEEL_EFFECT_DONT_CHANGE,
|
||||
LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParametersPolar(
|
||||
LONG lAngle,
|
||||
DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lMagStart = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lMagEnd = FEEL_EFFECT_DONT_CHANGE,
|
||||
LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X,
|
||||
LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y,
|
||||
DWORD dwDuration = FEEL_RAMP_DEFAULT_DURATION,
|
||||
LONG lMagStart = FEEL_RAMP_DEFAULT_MAGNITUDE_START,
|
||||
LONG lMagEnd = FEEL_RAMP_DEFAULT_MAGNITUDE_END,
|
||||
LPFEEL_ENVELOPE pEnvelope = NULL
|
||||
);
|
||||
|
||||
virtual BOOL
|
||||
InitializePolar(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lAngle = FEEL_EFFECT_DEFAULT_ANGLE,
|
||||
DWORD dwDuration = FEEL_RAMP_DEFAULT_DURATION,
|
||||
LONG lMagStart = FEEL_RAMP_DEFAULT_MAGNITUDE_START,
|
||||
LONG lMagEnd = FEEL_RAMP_DEFAULT_MAGNITUDE_END,
|
||||
LPFEEL_ENVELOPE pEnvelope = NULL
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
BOOL
|
||||
set_parameters(
|
||||
DWORD dwfCoordinates,
|
||||
LONG lDirection0,
|
||||
LONG lDirection1,
|
||||
DWORD dwDuration,
|
||||
LONG lMagStart,
|
||||
LONG lMagEnd,
|
||||
LPFEEL_ENVELOPE pEnvelope
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
FEEL_RAMPFORCE m_RampForce;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelRamp::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_RampForce);
|
||||
}
|
||||
|
||||
#endif // !defined(AFX_FEELRAMP_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,191 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelSpring.h
|
||||
|
||||
PURPOSE: Feelit API Spring Class
|
||||
|
||||
STARTED: 10/10/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FEELSPRING_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FEELSPRING_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include "FeelCondition.h"
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
#define FEEL_SPRING_DEFAULT_STIFFNESS 2500
|
||||
#define FEEL_SPRING_DEFAULT_SATURATION 10000
|
||||
#define FEEL_SPRING_DEFAULT_DEADBAND 100
|
||||
#define FEEL_SPRING_DEFAULT_CENTER_POINT FEEL_EFFECT_MOUSE_POS_AT_START
|
||||
#define FEEL_SPRING_DEFAULT_DIRECTION_X 1
|
||||
#define FEEL_SPRING_DEFAULT_DIRECTION_Y 0
|
||||
#define FEEL_SPRING_DEFAULT_ANGLE 0
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_SPRING_DEFAULT_STIFFNESS FEEL_SPRING_DEFAULT_STIFFNESS
|
||||
#define FORCE_SPRING_DEFAULT_SATURATION FEEL_SPRING_DEFAULT_SATURATION
|
||||
#define FORCE_SPRING_DEFAULT_DEADBAND FEEL_SPRING_DEFAULT_DEADBAND
|
||||
#define FORCE_SPRING_DEFAULT_CENTER_POINT FEEL_SPRING_DEFAULT_CENTER_POINT
|
||||
#define FORCE_SPRING_DEFAULT_DIRECTION_X FEEL_SPRING_DEFAULT_DIRECTION_X
|
||||
#define FORCE_SPRING_DEFAULT_DIRECTION_Y FEEL_SPRING_DEFAULT_DIRECTION_Y
|
||||
#define FORCE_SPRING_DEFAULT_ANGLE FEEL_SPRING_DEFAULT_ANGLE
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelSpring
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelSpring : public CFeelCondition
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelSpring();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelSpring();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParameters(
|
||||
POINT pntCenter,
|
||||
LONG lStiffness = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwDeadband = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
BOOL
|
||||
ChangeParametersPolar(
|
||||
POINT pntCenter,
|
||||
LONG lStiffness,
|
||||
DWORD dwSaturation,
|
||||
DWORD dwDeadband,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
Initialize(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lStiffness = FEEL_SPRING_DEFAULT_STIFFNESS,
|
||||
DWORD dwSaturation = FEEL_SPRING_DEFAULT_SATURATION,
|
||||
DWORD dwDeadband = FEEL_SPRING_DEFAULT_DEADBAND,
|
||||
DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH,
|
||||
POINT pntCenter = FEEL_SPRING_DEFAULT_CENTER_POINT,
|
||||
LONG lDirectionX = FEEL_SPRING_DEFAULT_DIRECTION_X,
|
||||
LONG lDirectionY = FEEL_SPRING_DEFAULT_DIRECTION_Y,
|
||||
BOOL bUseDeviceCoordinates = FALSE
|
||||
);
|
||||
|
||||
virtual BOOL
|
||||
InitializePolar(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lStiffness,
|
||||
DWORD dwSaturation,
|
||||
DWORD dwDeadband,
|
||||
POINT pntCenter,
|
||||
LONG lAngle,
|
||||
BOOL bUseDeviceCoordinates = FALSE
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelSpring::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Spring);
|
||||
}
|
||||
|
||||
#endif // !defined(AFX_FEELSPRING_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
|
|
@ -1,287 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FeelTexture.h
|
||||
|
||||
PURPOSE: Texture Class for Feelit API Foundation Classes
|
||||
|
||||
STARTED: 2/27/98
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/2/99 jrm: Added GetIsCompatibleGUID
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FeelTexture_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FeelTexture_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include "FeelBaseTypes.h"
|
||||
#include "FeelEffect.h"
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
// Constants
|
||||
//================================================================
|
||||
|
||||
const POINT FEEL_TEXTURE_PT_NULL = { 0, 0 };
|
||||
const POINT FEEL_TEXTURE_DEFAULT_OFFSET_POINT = { 0, 0};
|
||||
|
||||
#define FEEL_TEXTURE_DEFAULT_MAGNITUDE 5000
|
||||
#define FEEL_TEXTURE_DEFAULT_WIDTH 10
|
||||
#define FEEL_TEXTURE_DEFAULT_SPACING 20
|
||||
|
||||
//
|
||||
// FORCE --> FEEL Wrappers
|
||||
//
|
||||
#define FORCE_TEXTURE_PT_NULL FEEL_TEXTURE_PT_NULL
|
||||
#define FORCE_TEXTURE_DEFAULT_OFFSET_POINT FEEL_TEXTURE_DEFAULT_OFFSET_POINT
|
||||
|
||||
#define FORCE_TEXTURE_DEFAULT_MAGNITUDE FEEL_TEXTURE_DEFAULT_MAGNITUDE
|
||||
#define FORCE_TEXTURE_DEFAULT_WIDTH FEEL_TEXTURE_DEFAULT_WIDTH
|
||||
#define FORCE_TEXTURE_DEFAULT_SPACING FEEL_TEXTURE_DEFAULT_SPACING
|
||||
|
||||
|
||||
//================================================================
|
||||
// CFeelTexture
|
||||
//================================================================
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFeelTexture : public CFeelEffect
|
||||
{
|
||||
//
|
||||
// CONSTRUCTOR/DESTRUCTOR
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
CFeelTexture();
|
||||
|
||||
// Destructor
|
||||
virtual
|
||||
~CFeelTexture();
|
||||
|
||||
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
virtual BOOL
|
||||
GetIsCompatibleGUID(
|
||||
GUID &guid
|
||||
);
|
||||
|
||||
// Use this form for single-axis and dual-axis effects
|
||||
BOOL
|
||||
ChangeTextureParams(
|
||||
LPCFEELIT_TEXTURE pTextureX,
|
||||
LPCFEELIT_TEXTURE pTextureY
|
||||
);
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
ChangeTextureParams(
|
||||
LPCFEELIT_TEXTURE pTexture,
|
||||
LONG lDirectionX,
|
||||
LONG lDirectionY
|
||||
);
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
ChangeTextureParamsPolar(
|
||||
LPCFEELIT_TEXTURE pTexture,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
// Use this form for single-axis, dual-axis symetrical, or directional effects
|
||||
BOOL
|
||||
ChangeTextureParams(
|
||||
LONG lPosBumpMag = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwPosBumpWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwPosBumpSpacing = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lNegBumpMag = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwNegBumpWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwNegBumpSpacing = FEEL_EFFECT_DONT_CHANGE,
|
||||
POINT pntOffset = FEEL_EFFECT_DONT_CHANGE_POINT,
|
||||
LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
// Use this form for single-axis, dual-axis symetrical, or directional effects
|
||||
BOOL
|
||||
ChangeTextureParamsPolar(
|
||||
LONG lPosBumpMag = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwPosBumpWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwPosBumpSpacing = FEEL_EFFECT_DONT_CHANGE,
|
||||
LONG lNegBumpMag = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwNegBumpWidth = FEEL_EFFECT_DONT_CHANGE,
|
||||
DWORD dwNegBumpSpacing = FEEL_EFFECT_DONT_CHANGE,
|
||||
POINT pntOffset = FEEL_EFFECT_DONT_CHANGE_POINT,
|
||||
LONG lAngle = FEEL_EFFECT_DONT_CHANGE
|
||||
);
|
||||
|
||||
BOOL
|
||||
SetOffset(
|
||||
POINT pntOffset
|
||||
);
|
||||
|
||||
//
|
||||
// OPERATIONS
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
// Use this form for single-axis and dual-axis effects
|
||||
BOOL
|
||||
InitTexture(
|
||||
CFeelDevice* pDevice,
|
||||
LPCFEELIT_TEXTURE pTextureX,
|
||||
LPCFEELIT_TEXTURE pTextureY
|
||||
);
|
||||
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
InitTexture(
|
||||
CFeelDevice* pDevice,
|
||||
LPCFEELIT_TEXTURE pTexture,
|
||||
LONG lDirectionX,
|
||||
LONG lDirectionY
|
||||
);
|
||||
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
InitTexturePolar(
|
||||
CFeelDevice* pDevice,
|
||||
LPCFEELIT_TEXTURE pTexture,
|
||||
LONG lAngle
|
||||
);
|
||||
|
||||
|
||||
// Use this form for single-axis, dual-axis symetrical, or directional effects
|
||||
BOOL
|
||||
InitTexture(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lPosBumpMag = FEEL_TEXTURE_DEFAULT_MAGNITUDE,
|
||||
DWORD dwPosBumpWidth = FEEL_TEXTURE_DEFAULT_WIDTH,
|
||||
DWORD dwPosBumpSpacing = FEEL_TEXTURE_DEFAULT_SPACING,
|
||||
LONG lNegBumpMag = FEEL_TEXTURE_DEFAULT_MAGNITUDE,
|
||||
DWORD dwNegBumpWidth = FEEL_TEXTURE_DEFAULT_WIDTH,
|
||||
DWORD dwNegBumpSpacing = FEEL_TEXTURE_DEFAULT_SPACING,
|
||||
DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH,
|
||||
POINT pntOffset = FEEL_TEXTURE_DEFAULT_OFFSET_POINT,
|
||||
LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X,
|
||||
LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y
|
||||
);
|
||||
|
||||
// Use this form for directional effects
|
||||
BOOL
|
||||
InitTexturePolar(
|
||||
CFeelDevice* pDevice,
|
||||
LONG lPosBumpMag = FEEL_TEXTURE_DEFAULT_MAGNITUDE,
|
||||
DWORD dwPosBumpWidth = FEEL_TEXTURE_DEFAULT_WIDTH,
|
||||
DWORD dwPosBumpSpacing = FEEL_TEXTURE_DEFAULT_SPACING,
|
||||
LONG lNegBumpMag = FEEL_TEXTURE_DEFAULT_MAGNITUDE,
|
||||
DWORD dwNegBumpWidth = FEEL_TEXTURE_DEFAULT_WIDTH,
|
||||
DWORD dwNegBumpSpacing = FEEL_TEXTURE_DEFAULT_SPACING,
|
||||
POINT pntOffset = FEEL_TEXTURE_DEFAULT_OFFSET_POINT,
|
||||
LONG lAngle = FEEL_EFFECT_DEFAULT_ANGLE
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
BOOL
|
||||
set_parameters(
|
||||
DWORD dwfAxis,
|
||||
DWORD dwfCoordinates,
|
||||
LONG lDirection0,
|
||||
LONG lDirection1,
|
||||
LPCFEELIT_TEXTURE pTextureX,
|
||||
LPCFEELIT_TEXTURE pTextureY
|
||||
);
|
||||
|
||||
BOOL
|
||||
set_parameters(
|
||||
DWORD dwfAxis,
|
||||
DWORD dwfCoordinates,
|
||||
LONG lDirection0,
|
||||
LONG lDirection1,
|
||||
LONG lPosBumpMag,
|
||||
DWORD dwPosBumpWidth,
|
||||
DWORD dwPosBumpSpacing,
|
||||
LONG lNegBumpMag,
|
||||
DWORD dwNegBumpWidth,
|
||||
DWORD dwNegBumpSpacing,
|
||||
POINT pntOffset
|
||||
);
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
FEEL_TEXTURE m_aTexture[2];
|
||||
DWORD m_dwfAxis;
|
||||
|
||||
protected:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// INLINES
|
||||
//
|
||||
|
||||
inline BOOL
|
||||
CFeelTexture::GetIsCompatibleGUID(GUID &guid)
|
||||
{
|
||||
return IsEqualGUID(guid, GUID_Feel_Texture);
|
||||
}
|
||||
|
||||
#endif // !defined(AFX_FeelTexture_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
|
@ -1,78 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1997,8,9 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FFC.h
|
||||
|
||||
PURPOSE: Class Types for the Force Foundation Classes
|
||||
|
||||
STARTED: 10/29/97
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(AFX_FFC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
#define AFX_FFC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
|
||||
#include "FeelBox.h"
|
||||
#include "FeelCondition.h"
|
||||
#include "FeelConstant.h"
|
||||
#include "FeelDamper.h"
|
||||
#include "FeelDevice.h"
|
||||
#include "FeelDXDevice.h"
|
||||
#include "FeelEffect.h"
|
||||
#include "FeelEllipse.h"
|
||||
#include "FeelEnclosure.h"
|
||||
#include "FeelMouse.h"
|
||||
#include "FeelFriction.h"
|
||||
#include "FeelGrid.h"
|
||||
#include "FeelInertia.h"
|
||||
#include "FeelPeriodic.h"
|
||||
#include "FeelProjects.h"
|
||||
#include "FeelRamp.h"
|
||||
#include "FeelSpring.h"
|
||||
#include "FeelTexture.h"
|
||||
#include "FFCErrors.h"
|
||||
|
||||
|
||||
#endif // !defined(AFX_FFC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,171 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright (c) 1999 Immersion Corporation
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation may be granted without fee;
|
||||
interested parties are encouraged to request permission from
|
||||
Immersion Corporation
|
||||
2158 Paragon Drive
|
||||
San Jose, CA 95131
|
||||
408-467-1900
|
||||
|
||||
IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
|
||||
IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
FILE: FFCErrors.h
|
||||
|
||||
PURPOSE: Error codes returned in FFC; Error handling in FFC
|
||||
|
||||
STARTED: 2/28/99 by Jeff Mallett
|
||||
|
||||
NOTES/REVISIONS:
|
||||
3/2/99 jrm (Jeff Mallett): Force-->Feel renaming
|
||||
3/6/99 jrm: Added user error handling control
|
||||
3/15/99 jrm: __declspec(dllimport/dllexport) the whole class
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
|
||||
#if !defined(FFCERRORS_H__INCLUDED_)
|
||||
#define FFCERRORS_H__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef _FFCDLL_
|
||||
#define DLLFFC __declspec(dllimport)
|
||||
#else
|
||||
#define DLLFFC __declspec(dllexport)
|
||||
#endif
|
||||
|
||||
#include <winerror.h>
|
||||
#include "FeelBaseTypes.h"
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Error Codes
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
typedef enum {
|
||||
FFC_ERR_OK = 0,
|
||||
|
||||
FFC_ERR_UNKNOWN_ERROR = 1,
|
||||
|
||||
FFC_ERR_ALLOCATION_FAILED = 2,
|
||||
FFC_ERR_INVALID_PARAMETER = 3,
|
||||
FFC_ERR_NULL_PARAMETER = 4,
|
||||
FFC_ERR_WRONG_FORM = 5,
|
||||
|
||||
FFC_ERR_DEVICE_IS_NULL = 6,
|
||||
FFC_ERR_INVALID_GUID = 7,
|
||||
FFC_ERR_EFFECT_NOT_INITIALIZED = 8,
|
||||
|
||||
FFC_ERR_CANT_INITIALIZE_DEVICE = 9,
|
||||
|
||||
FFC_ERR_CANT_CREATE_EFFECT = 10,
|
||||
FFC_ERR_CANT_CREATE_EFFECT_FROM_IFR = 11,
|
||||
FFC_ERR_NO_EFFECTS_FOUND = 12,
|
||||
FFC_ERR_EFFECT_IS_COMPOUND = 13,
|
||||
|
||||
FFC_ERR_PROJECT_ALREADY_OPEN = 14,
|
||||
FFC_ERR_PROJECT_NOT_OPEN = 15
|
||||
} FFC_ERROR_CODE;
|
||||
|
||||
typedef enum {
|
||||
FFC_OUTPUT_ERR_TO_DEBUG = 0x0001,
|
||||
FFC_OUTPUT_ERR_TO_DIALOG = 0x0002
|
||||
} FFC_ERROR_HANDLING_FLAGS;
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Macros
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
//
|
||||
// ------ PUBLIC MACROS ------
|
||||
//
|
||||
#define FFC_GET_LAST_ERROR CFFCErrors::GetLastErrorCode()
|
||||
#define FFC_SET_ERROR_HANDLING CFFCErrors::SetErrorHandling
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE MACROS ------
|
||||
//
|
||||
#if (FFC_VERSION >= 0x0110)
|
||||
#define FFC_SET_ERROR(err) CFFCErrors::SetErrorCode(err, __FILE__, __LINE__)
|
||||
#else
|
||||
#define FFC_SET_ERROR(err) CFFCErrors::SetErrorCode(err)
|
||||
#endif
|
||||
#define FFC_CLEAR_ERROR FFC_SET_ERROR(FFC_ERR_OK)
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* CFFCErrors
|
||||
*
|
||||
****************************************************************************/
|
||||
// All members are static. Don't bother instantiating an object of this class.
|
||||
|
||||
//
|
||||
// ------ PUBLIC INTERFACE ------
|
||||
//
|
||||
|
||||
class DLLFFC CFFCErrors
|
||||
{
|
||||
//
|
||||
// ATTRIBUTES
|
||||
//
|
||||
|
||||
public:
|
||||
|
||||
static HRESULT
|
||||
GetLastErrorCode()
|
||||
{ return m_Err; }
|
||||
|
||||
static void
|
||||
SetErrorHandling(unsigned long dwFlags)
|
||||
{ m_dwErrHandlingFlags = dwFlags; }
|
||||
|
||||
|
||||
//
|
||||
// ------ PRIVATE INTERFACE ------
|
||||
//
|
||||
|
||||
// Internally used by FFC classes
|
||||
static void
|
||||
SetErrorCode(
|
||||
HRESULT err
|
||||
#if (FFC_VERSION >= 0x0110)
|
||||
, const char *sFile, int nLine
|
||||
#endif
|
||||
);
|
||||
|
||||
//
|
||||
// HELPERS
|
||||
//
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
// INTERNAL DATA
|
||||
//
|
||||
|
||||
private:
|
||||
|
||||
static HRESULT m_Err;
|
||||
static unsigned long m_dwErrHandlingFlags;
|
||||
};
|
||||
|
||||
|
||||
#endif // FFCERRORS_H__INCLUDED_
|
|
@ -1,680 +0,0 @@
|
|||
// Filename:- fffx.cpp (Force-Feedback FX)
|
||||
//
|
||||
// (Function names with "_FF_" beginnings are my internal stuff only, "FF_" beginnings are for external stuff)
|
||||
//
|
||||
#define INITGUID // this will need removing if already defined in someone else's module. Only one must exist in whole game
|
||||
|
||||
#include "../../client/client.h"
|
||||
#include "../win_local.h"
|
||||
#include "ffc.h"
|
||||
#include "fffx_feel.h"
|
||||
|
||||
// these now MUST default to NULL...
|
||||
//
|
||||
CFeelDevice *g_pFeelDevice=NULL;
|
||||
CFeelProject *g_pFeelProject=NULL;
|
||||
CFeelSpring *g_pFeelSpring=NULL;
|
||||
|
||||
|
||||
ffFX_e ffFXLoaded[MAX_CONCURRENT_FFFXs];
|
||||
|
||||
//extern HINSTANCE global_hInstance;
|
||||
//extern HWND cl_hwnd;
|
||||
extern WinVars_t g_wv;
|
||||
|
||||
|
||||
extern cvar_t *in_joystick;
|
||||
cvar_t *use_ff;
|
||||
cvar_t *ff_defaultTension;
|
||||
|
||||
|
||||
void _FF_ClearUsageArray(void);
|
||||
void _FF_ClearFXSlot(int i);
|
||||
void _FF_ClearCreatePlayFXSlot(int iSlotNum, ffFX_e fffx);
|
||||
void _FF_CreatePlayFXSlot(int iSlotNum, ffFX_e fffx);
|
||||
void _FF_PlayFXSlot(int iSlotNum);
|
||||
|
||||
|
||||
|
||||
// externally accessed
|
||||
qboolean FF_IsAvailable(void)
|
||||
{
|
||||
return g_pFeelDevice?TRUE:FALSE;
|
||||
}
|
||||
|
||||
qboolean FF_IsMouse(void)
|
||||
{
|
||||
if (g_pFeelDevice && (g_pFeelDevice->GetDeviceType() == FEEL_DEVICETYPE_MOUSE))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
// 4 semi-useful CMD functions...
|
||||
void CMD_FF_UseMouse(void)
|
||||
{
|
||||
FF_Init(TRUE);
|
||||
}
|
||||
|
||||
void CMD_FF_UseJoy(void)
|
||||
{
|
||||
FF_Init(FALSE);
|
||||
}
|
||||
|
||||
// arg = 0..3
|
||||
//
|
||||
void CMD_FF_Tension(void)
|
||||
{
|
||||
if (Cmd_Argc() != 2)
|
||||
{
|
||||
Com_Printf ("ff_tension <tension [0..3]> (default = 1)\n");
|
||||
return;
|
||||
}
|
||||
|
||||
int iTension = atoi(Cmd_Argv(1));
|
||||
if (iTension<0 || iTension>3)
|
||||
{
|
||||
Com_Printf ("ff_tension <tension [0..3]>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_pFeelSpring)
|
||||
{
|
||||
Com_Printf(va("Setting tension %d\n",iTension));
|
||||
Cvar_Set(ff_defaultTension->name,va("%d",iTension));
|
||||
FF_SetTension(iTension);
|
||||
}
|
||||
else
|
||||
{
|
||||
Com_Printf("No spring device\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char* psName;
|
||||
ffFX_e eFXNum;
|
||||
}FFFX_LOOKUP;
|
||||
|
||||
#define FFFX_ENTRY(blah) {#blah,(ffFX_e)fffx_ ## blah}
|
||||
FFFX_LOOKUP FFFX_Lookup[fffx_NUMBEROF]=
|
||||
{
|
||||
FFFX_ENTRY( RandomNoise ),
|
||||
FFFX_ENTRY( AircraftCarrierTakeOff ), // this one is pointless / dumb
|
||||
FFFX_ENTRY( BasketballDribble ),
|
||||
FFFX_ENTRY( CarEngineIdle ),
|
||||
FFFX_ENTRY( ChainsawIdle ),
|
||||
FFFX_ENTRY( ChainsawInAction ),
|
||||
FFFX_ENTRY( DieselEngineIdle ),
|
||||
FFFX_ENTRY( Jump ),
|
||||
FFFX_ENTRY( Land ),
|
||||
FFFX_ENTRY( MachineGun ),
|
||||
FFFX_ENTRY( Punched ),
|
||||
FFFX_ENTRY( RocketLaunch ),
|
||||
FFFX_ENTRY( SecretDoor ),
|
||||
FFFX_ENTRY( SwitchClick ),
|
||||
FFFX_ENTRY( WindGust ),
|
||||
FFFX_ENTRY( WindShear ), // also pretty crap
|
||||
FFFX_ENTRY( Pistol ),
|
||||
FFFX_ENTRY( Shotgun ),
|
||||
FFFX_ENTRY( Laser1 ),
|
||||
FFFX_ENTRY( Laser2 ),
|
||||
FFFX_ENTRY( Laser3 ),
|
||||
FFFX_ENTRY( Laser4 ),
|
||||
FFFX_ENTRY( Laser5 ),
|
||||
FFFX_ENTRY( Laser6 ),
|
||||
FFFX_ENTRY( OutOfAmmo ),
|
||||
FFFX_ENTRY( LightningGun ),
|
||||
FFFX_ENTRY( Missile ),
|
||||
FFFX_ENTRY( GatlingGun ),
|
||||
FFFX_ENTRY( ShortPlasma ),
|
||||
FFFX_ENTRY( PlasmaCannon1 ),
|
||||
FFFX_ENTRY( PlasmaCannon2 ),
|
||||
FFFX_ENTRY( Cannon )
|
||||
};
|
||||
|
||||
void CMD_FF_Play(void)
|
||||
{
|
||||
if (Cmd_Argc() != 2 && Cmd_Argc() != 3)
|
||||
{
|
||||
Com_Printf ("ff_play <n> (where n = 0..%d) || ff_play name \"fxname\"\n",fffx_NUMBEROF-1);
|
||||
return;
|
||||
}
|
||||
|
||||
ffFX_e eFX = fffx_NULL;
|
||||
|
||||
if (!Q_stricmp(Cmd_Argv(1),"name"))
|
||||
{
|
||||
if (Cmd_Argc() != 3)
|
||||
{
|
||||
Com_Printf ("ff_play <n> (where n = 0..%d) || ff_play name \"fxname\"\n",0,fffx_NUMBEROF-1);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i=0; i<fffx_NUMBEROF; i++)
|
||||
{
|
||||
if (!Q_stricmp(FFFX_Lookup[i].psName,Cmd_Argv(2)))
|
||||
{
|
||||
eFX = FFFX_Lookup[i].eFXNum;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
eFX = (ffFX_e) atoi(Cmd_Argv(1));
|
||||
}
|
||||
|
||||
if (eFX>=0 && eFX<fffx_NUMBEROF)
|
||||
{
|
||||
Com_Printf ("Playing FFFX # %d...(%s)\n",eFX,FFFX_Lookup[eFX].psName);
|
||||
FF_Play(eFX);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// arg 0..n..10000
|
||||
void CMD_FF_Spring(void)
|
||||
{
|
||||
if (Cmd_Argc() != 2)
|
||||
{
|
||||
Com_Printf ("ff_spring <0..10000>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
long lSpring = atoi(Cmd_Argv(1));
|
||||
if (lSpring<0 || lSpring>10000)
|
||||
{
|
||||
Com_Printf ("ff_spring <0..10000>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_pFeelSpring)
|
||||
{
|
||||
Com_Printf(va("Setting spring to %d\n",lSpring));
|
||||
FF_SetSpring(lSpring);
|
||||
}
|
||||
else
|
||||
{
|
||||
Com_Printf("No spring device\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Called once only during .exe lifetime...
|
||||
//
|
||||
void FF_Init(qboolean bTryMouseFirst)
|
||||
{
|
||||
FF_Shutdown();
|
||||
|
||||
Cmd_AddCommand ("ff_usemouse", CMD_FF_UseMouse);
|
||||
Cmd_AddCommand ("ff_usejoy", CMD_FF_UseJoy);
|
||||
Cmd_AddCommand ("ff_tension", CMD_FF_Tension);
|
||||
Cmd_AddCommand ("ff_spring", CMD_FF_Spring);
|
||||
Cmd_AddCommand ("ff_play", CMD_FF_Play);
|
||||
|
||||
// ====================================
|
||||
|
||||
Com_Printf("\n" S_COLOR_CYAN "------- Force Feedback Initialization -------\n");
|
||||
|
||||
// for the moment default to OFF until usage tables are in...
|
||||
use_ff = Cvar_Get ("use_ff", "0", CVAR_ARCHIVE);
|
||||
ff_defaultTension = Cvar_Get ("ff_defaultTension", "1", CVAR_ARCHIVE);
|
||||
|
||||
// don't bother initializing if user specifically turned off force feedback...
|
||||
//
|
||||
if (!use_ff->value)
|
||||
{
|
||||
Com_Printf("...inhibited, not initializing\n\n");
|
||||
return;
|
||||
}
|
||||
|
||||
Com_Printf("Creating feedback device:\n");
|
||||
|
||||
if ( bTryMouseFirst )
|
||||
{
|
||||
CFeelMouse* m_pFeelMouse = new CFeelMouse;
|
||||
if (m_pFeelMouse)
|
||||
{
|
||||
if (m_pFeelMouse->Initialize( g_wv.hInstance, g_wv.hWnd))
|
||||
{
|
||||
g_pFeelDevice = m_pFeelMouse;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete m_pFeelMouse;
|
||||
m_pFeelMouse = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!g_pFeelDevice)
|
||||
{
|
||||
// try a general DI FF device...
|
||||
//
|
||||
CFeelDXDevice* m_pFeelDXDevice = new CFeelDXDevice;
|
||||
if (m_pFeelDXDevice)
|
||||
{
|
||||
if (m_pFeelDXDevice->Initialize( g_wv.hInstance, g_wv.hWnd))
|
||||
{
|
||||
g_pFeelDevice = m_pFeelDXDevice;
|
||||
}
|
||||
else
|
||||
{
|
||||
delete m_pFeelDXDevice;
|
||||
m_pFeelDXDevice = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// g_pFeelDevice = CFeelDevice::CreateDevice(g_wv.hInstance, g_wv.hWnd);
|
||||
if (!g_pFeelDevice)
|
||||
{
|
||||
Com_Printf("...no feedback devices found\n");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
_FeelInitEffects();
|
||||
|
||||
for (int _i=0; _i<MAX_CONCURRENT_FFFXs; _i++)
|
||||
{
|
||||
ffFXLoaded[_i] = fffx_NULL;
|
||||
}
|
||||
|
||||
if (g_pFeelDevice->GetDeviceType() == FEEL_DEVICETYPE_MOUSE)
|
||||
{
|
||||
Com_Printf("...found FEELit Mouse\n");
|
||||
g_pFeelDevice->UsesWin32MouseServices(FALSE);
|
||||
}
|
||||
else if (g_pFeelDevice->GetDeviceType() == FEEL_DEVICETYPE_DIRECTINPUT)
|
||||
{
|
||||
Com_Printf("...found feedback device\n");
|
||||
g_pFeelSpring = new CFeelSpring;
|
||||
if (!g_pFeelSpring->Initialize( g_pFeelDevice,
|
||||
2000, //10000, // LONG lStiffness = FEEL_SPRING_DEFAULT_STIFFNESS
|
||||
10000, //5000, // DWORD dwSaturation = FEEL_SPRING_DEFAULT_SATURATION
|
||||
1000, //0, // DWORD dwDeadband = FEEL_SPRING_DEFAULT_DEADBAND // must be 0..n..10000
|
||||
FEEL_EFFECT_AXIS_BOTH, // DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH
|
||||
FEEL_SPRING_DEFAULT_CENTER_POINT, // POINT pntCenter = FEEL_SPRING_DEFAULT_CENTER_POINT
|
||||
FEEL_EFFECT_DEFAULT_DIRECTION_X, // LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X
|
||||
FEEL_EFFECT_DEFAULT_DIRECTION_Y, // LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y
|
||||
TRUE // TRUE = rel coords, else screen coords // BOOL bUseDeviceCoordinates = FALSE
|
||||
)
|
||||
)
|
||||
{
|
||||
Com_Printf("...(no device return spring)\n");
|
||||
delete g_pFeelSpring;
|
||||
g_pFeelSpring = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
Com_Printf("...device return spring ok\n");
|
||||
FF_SetTension(ff_defaultTension->integer); // 0..3
|
||||
}
|
||||
}// if (g_pFeelDevice->GetDeviceType() == FEEL_DEVICETYPE_DIRECTINPUT)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// call this at app shutdown... (or when switching controllers)
|
||||
//
|
||||
// (also called by FF_Init in case you're switching controllers so do everything
|
||||
// as if-protected)
|
||||
//
|
||||
void FF_Shutdown(void)
|
||||
{
|
||||
// note the check first before print, since this is called from the init code
|
||||
// as well, and it'd be weird to see the sutdown string first...
|
||||
//
|
||||
if (g_pFeelSpring || g_pFeelDevice)
|
||||
{
|
||||
Com_Printf("\n" S_COLOR_CYAN "------- Force Feedback Shutdown -------\n");
|
||||
}
|
||||
|
||||
if (g_pFeelSpring)
|
||||
{
|
||||
Com_Printf("...closing return spring\n");
|
||||
delete g_pFeelSpring;
|
||||
g_pFeelSpring = NULL;
|
||||
}
|
||||
|
||||
if (g_pFeelDevice)
|
||||
{
|
||||
Com_Printf("...closing feedback device\n");
|
||||
_FF_ClearUsageArray();
|
||||
delete g_pFeelDevice;
|
||||
g_pFeelDevice = NULL;
|
||||
}
|
||||
|
||||
Cmd_RemoveCommand ("ff_usemouse");
|
||||
Cmd_RemoveCommand ("ff_usejoy");
|
||||
Cmd_RemoveCommand ("ff_tension");
|
||||
Cmd_RemoveCommand ("ff_spring");
|
||||
Cmd_RemoveCommand ("ff_play");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void FF_EnsurePlaying(ffFX_e fffx)
|
||||
{
|
||||
if (fffx<0 || fffx>=fffx_NUMBEROF)
|
||||
return;
|
||||
|
||||
// if user has specifically turned off force feedback at command line,
|
||||
// or is not using the joystick as current input method (though this can be ignored because stick has a hands-on sensor),
|
||||
// then forget it...
|
||||
//
|
||||
if (!use_ff->value)
|
||||
return;
|
||||
|
||||
|
||||
if (FF_IsAvailable())
|
||||
{
|
||||
// Have we already got this FF FX loaded?
|
||||
//
|
||||
for (int i=0; i<MAX_CONCURRENT_FFFXs; i++)
|
||||
{
|
||||
if (ffFXLoaded[i]==fffx)
|
||||
{
|
||||
// yes, is it playing now?
|
||||
//
|
||||
if (_FeelEffectPlaying(i))
|
||||
return;
|
||||
|
||||
_FF_PlayFXSlot(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if we got this far then it ain't even loaded, so...
|
||||
//
|
||||
FF_Play(fffx);
|
||||
|
||||
}// if (FF_IsAvailable())
|
||||
|
||||
}// void FF_EnsurePlaying(ffFX_e fffx)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// strictly speaking I suppose I should check that the current player is actually using a
|
||||
// joystick as his current input method before sending an FF FX to it, but considering the stick
|
||||
// will only move if he's holding it then he's daft to hold it and still use the keyboard or
|
||||
// something, so for now I'll just leave it in to avoid yet another IF statement...
|
||||
//
|
||||
// Since the joystick appears to run out of FX ram very quickly I'll have to use a sort of rolling
|
||||
// buffer principle I think...
|
||||
//
|
||||
// (watch the mid-func returns if you put anything at the end!)
|
||||
//
|
||||
void _FF_Play(ffFX_e fffx)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (fffx<0 || fffx>=fffx_NUMBEROF)
|
||||
return;
|
||||
|
||||
// if user has specifically turned off force feedback at command line,
|
||||
// or is not using the joystick as current input method (though this can be ignored because stick has a hands-on sensor),
|
||||
// then forget it...
|
||||
//
|
||||
if (!use_ff->value)
|
||||
return;
|
||||
|
||||
if (FF_IsAvailable())
|
||||
{
|
||||
// first, search for an instance of this FF FX that's already loaded, if found, start it off again...
|
||||
//
|
||||
for (i=0; i<MAX_CONCURRENT_FFFXs; i++)
|
||||
{
|
||||
if (ffFXLoaded[i]==fffx)
|
||||
{
|
||||
_FF_PlayFXSlot(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// ok, so we didn't find one of these already here, so search for any FF FX that's loaded but
|
||||
// finished playing...
|
||||
//
|
||||
// (note that I prefer to re-use an existing one before looking for an empty slot so
|
||||
// there's less chance of the create call failing because of lack of j/s ram)
|
||||
//
|
||||
for (i=0; i<MAX_CONCURRENT_FFFXs; i++)
|
||||
{
|
||||
if (ffFXLoaded[i] != fffx_NULL)
|
||||
{
|
||||
// slot has an effect, has it finished?
|
||||
//
|
||||
if (!_FeelEffectPlaying(i))
|
||||
{
|
||||
_FF_ClearCreatePlayFXSlot(i,fffx);
|
||||
return;
|
||||
}
|
||||
|
||||
}// if (lpDIEffectsCreated[i])
|
||||
}// for (i=0; i<MAX_CONCURRENT_FFFXs; i++)
|
||||
|
||||
// At this point we haven't found an existing one to re-start, and there are no dead ones to reclaim, so
|
||||
// we just look for an empty slot...
|
||||
//
|
||||
for (i=0; i<MAX_CONCURRENT_FFFXs; i++)
|
||||
{
|
||||
if (ffFXLoaded[i] == fffx_NULL)
|
||||
{
|
||||
_FF_CreatePlayFXSlot(i,fffx);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Hmmm, we seem to have several FF FX's playing at once and we need another. Let's just trash one of the slots
|
||||
// and take it over anyway. I'll use the second slot in case the first is some sort of permanent engine throb
|
||||
// or similar...
|
||||
//
|
||||
_FF_ClearCreatePlayFXSlot(1,fffx);
|
||||
|
||||
}// if (FF_IsAvailable())
|
||||
|
||||
}// void FF_Play(ffFX_e fffx)
|
||||
|
||||
|
||||
// hack-wrapper around original play() function because the stick keeps going slack!
|
||||
//
|
||||
void FF_Play(ffFX_e fffx)
|
||||
{
|
||||
if (FF_IsAvailable())
|
||||
{
|
||||
_FF_Play(fffx);
|
||||
FF_SetTension(ff_defaultTension->integer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void _FF_ClearUsageArray(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<MAX_CONCURRENT_FFFXs; i++)
|
||||
{
|
||||
_FF_ClearFXSlot(i);
|
||||
}
|
||||
}
|
||||
|
||||
// called from more than one place, subroutinised to avoid bugs if method changes...
|
||||
//
|
||||
void _FF_ClearFXSlot(int i)
|
||||
{
|
||||
if (ffFXLoaded[i] != fffx_NULL)
|
||||
{
|
||||
_FeelClearEffect(i);
|
||||
}
|
||||
ffFXLoaded [i]=fffx_NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void _FF_ClearCreatePlayFXSlot(int iSlotNum, ffFX_e fffx)
|
||||
{
|
||||
// if this slot has a FF FX, zap it...
|
||||
//
|
||||
|
||||
if (ffFXLoaded[iSlotNum] != fffx_NULL)
|
||||
{
|
||||
// if playing, stop it...
|
||||
//
|
||||
if (_FeelEffectPlaying(iSlotNum))
|
||||
{
|
||||
if (!_FeelStopEffect(iSlotNum))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_FF_ClearFXSlot(iSlotNum); // so slot is left clear if err creating next ffFX_e
|
||||
_FF_CreatePlayFXSlot(iSlotNum,fffx);
|
||||
}
|
||||
|
||||
void _FF_CreatePlayFXSlot(int iSlotNum, ffFX_e fffx)
|
||||
{
|
||||
if (!_FeelCreateEffect(iSlotNum, fffx, g_pFeelDevice))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// effect created ok, so record it's type...
|
||||
//
|
||||
ffFXLoaded[iSlotNum]=fffx;
|
||||
//
|
||||
// ... and start it playing...
|
||||
//
|
||||
_FF_PlayFXSlot(iSlotNum);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _FF_PlayFXSlot(int iSlotNum)
|
||||
{
|
||||
|
||||
#define FFFX_DURATION 1 // 1 = duration (repeat count?) (could be 'INFINITE')
|
||||
#define FFFX_FLAGS 0 // 0 = special flags
|
||||
|
||||
if (!_FeelStartEffect(iSlotNum, FFFX_DURATION, FFFX_FLAGS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FF_StopAll(void)
|
||||
{
|
||||
if (FF_IsAvailable())
|
||||
{
|
||||
for (int i=0; i<MAX_CONCURRENT_FFFXs; i++)
|
||||
{
|
||||
if (ffFXLoaded[i] != fffx_NULL)
|
||||
{
|
||||
/*BOOL bRes = */_FeelStopEffect(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void FF_Stop(ffFX_e fffx)
|
||||
{
|
||||
if (fffx<0 || fffx>=fffx_NUMBEROF)
|
||||
return;
|
||||
|
||||
if (FF_IsAvailable())
|
||||
{
|
||||
for (int i=0; i<MAX_CONCURRENT_FFFXs; i++)
|
||||
{
|
||||
if (ffFXLoaded[i] == fffx)
|
||||
{
|
||||
/*BOOL bRes = */_FeelStopEffect(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 0..n..10000
|
||||
//
|
||||
qboolean FF_SetSpring(long lSpring)
|
||||
{
|
||||
static qboolean bFXPlaying = FALSE;
|
||||
|
||||
if (FF_IsAvailable())
|
||||
{
|
||||
// this plays a spring effect, and set the tension accordingly. Tension of 0 results in an effect-stop call
|
||||
//
|
||||
if (g_pFeelSpring)
|
||||
{
|
||||
if (lSpring)
|
||||
{
|
||||
if (!bFXPlaying && !g_pFeelSpring->Start())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
bFXPlaying = TRUE;
|
||||
|
||||
static POINT p={0,0};
|
||||
g_pFeelSpring->ChangeParameters(p, lSpring);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bFXPlaying && !g_pFeelSpring->Stop())
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
bFXPlaying = FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// tension is 0 (none) to 3 (max)...
|
||||
//
|
||||
qboolean FF_SetTension(int iTension)
|
||||
{
|
||||
static long lSpringValues[4] = {0, 1000, 5000, 10000};
|
||||
|
||||
if (iTension>3)
|
||||
iTension=3;
|
||||
if (iTension<0)
|
||||
iTension=0;
|
||||
|
||||
return FF_SetSpring(lSpringValues[iTension]);
|
||||
}
|
||||
|
||||
///////////////////////// eof //////////////////////////////
|
||||
|
|
@ -1,689 +0,0 @@
|
|||
// Filename:- fffx_Feel.cpp (Force-Feedback FX)
|
||||
|
||||
#include "../../client/client.h"
|
||||
//#include "stdafx.h"
|
||||
//#include "resource.h"
|
||||
#include "fffx_feel.h"
|
||||
|
||||
extern cvar_t* js_ffmult;
|
||||
|
||||
|
||||
#define MAX_EFFECTS_IN_COMPOUND 3 // This needs to be at least 3 for now. I can add array bounds checking later
|
||||
|
||||
CFeelEffect* g_pEffects[MAX_CONCURRENT_FFFXs][MAX_EFFECTS_IN_COMPOUND];
|
||||
|
||||
void _FeelInitEffects()
|
||||
{
|
||||
for (int i = 0; i < MAX_CONCURRENT_FFFXs; i++)
|
||||
{
|
||||
for (int j = 0; j < MAX_EFFECTS_IN_COMPOUND; j++)
|
||||
{
|
||||
g_pEffects[i][j] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOL _FeelCreateEffect(int iSlotNum, ffFX_e fffx, CFeelDevice* pFeelDevice)
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
FEELIT_ENVELOPE envelope;
|
||||
envelope.dwSize = sizeof(FEELIT_ENVELOPE);
|
||||
|
||||
switch (fffx)
|
||||
{
|
||||
case fffx_RandomNoise:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
7500 * js_ffmult->value, // magnitude
|
||||
95, // period
|
||||
10000, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_SawtoothDown);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
8300 * js_ffmult->value, // magnitude
|
||||
160, // period
|
||||
10000, // duration
|
||||
9000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
g_pEffects[iSlotNum][2] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][2]))->InitializePolar(pFeelDevice,
|
||||
8300 * js_ffmult->value, // magnitude
|
||||
34, // period
|
||||
10000, // duration
|
||||
31000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_AircraftCarrierTakeOff:
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 600000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 750000;
|
||||
|
||||
g_pEffects[iSlotNum][0] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
0, // angle
|
||||
2500, // duration
|
||||
10000 * js_ffmult->value, // magnitude
|
||||
&envelope))// envelope
|
||||
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_BasketballDribble:
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 40000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 30000;
|
||||
|
||||
g_pEffects[iSlotNum][0] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
18000, // angle
|
||||
150, // duration
|
||||
5000 * js_ffmult->value, // magnitude
|
||||
&envelope))// envelope
|
||||
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_CarEngineIdle:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
2500 * js_ffmult->value, // magnitude
|
||||
50, // period
|
||||
10000, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_ChainsawIdle:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
3600 * js_ffmult->value, // magnitude
|
||||
60, // period
|
||||
1000, // duration
|
||||
9000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
4000 * js_ffmult->value, // magnitude
|
||||
100, // period
|
||||
1000, // duration
|
||||
18000, // angle
|
||||
4000, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_ChainsawInAction:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
6700 * js_ffmult->value, // magnitude
|
||||
60, // period
|
||||
1000, // duration
|
||||
9000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
5000 * js_ffmult->value, // magnitude
|
||||
100, // period
|
||||
1000, // duration
|
||||
18000, // angle
|
||||
5000, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
g_pEffects[iSlotNum][2] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][2]))->InitializePolar(pFeelDevice,
|
||||
10000 * js_ffmult->value, // magnitude
|
||||
340, // period
|
||||
1000, // duration
|
||||
18000, // angle
|
||||
4000, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_DieselEngineIdle:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_SawtoothDown);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
2000 * js_ffmult->value, // magnitude
|
||||
250, // period
|
||||
10000, // duration
|
||||
18000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
4000 * js_ffmult->value, // magnitude
|
||||
125, // period
|
||||
10000, // duration
|
||||
18000, // angle
|
||||
1500, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Jump:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
5000 * js_ffmult->value, // magnitude
|
||||
500, // period
|
||||
300, // duration
|
||||
18000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Land:
|
||||
envelope.dwAttackLevel = 6000;
|
||||
envelope.dwAttackTime = 200000;
|
||||
envelope.dwFadeLevel = 3000;
|
||||
envelope.dwFadeTime = 50000;
|
||||
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
1000 * js_ffmult->value, // magnitude
|
||||
750, // period
|
||||
250, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
&envelope)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_MachineGun:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
3500 * js_ffmult->value, // magnitude
|
||||
70, // period
|
||||
1000, // duration
|
||||
0, // angle
|
||||
2500, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Punched:
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 0;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 50000;
|
||||
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
8000 * js_ffmult->value, // magnitude
|
||||
130, // period
|
||||
70, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
&envelope)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_RocketLaunch:
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 200000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 0;
|
||||
|
||||
g_pEffects[iSlotNum][1] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
18000, // angle
|
||||
400, // duration
|
||||
10000 * js_ffmult->value, // magnitude
|
||||
&envelope))// envelope
|
||||
success = FALSE;
|
||||
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 300000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 100000;
|
||||
|
||||
g_pEffects[iSlotNum][0] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
0, // angle
|
||||
1000, // duration
|
||||
10000 * js_ffmult->value, // magnitude
|
||||
&envelope))// envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_SecretDoor:
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 400000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 0;
|
||||
|
||||
g_pEffects[iSlotNum][0] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
0, // angle
|
||||
400, // duration
|
||||
10000 * js_ffmult->value, // magnitude
|
||||
&envelope))// envelope
|
||||
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_SwitchClick:
|
||||
g_pEffects[iSlotNum][0] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
18000, // angle
|
||||
50, // duration
|
||||
7000 * js_ffmult->value, // magnitude
|
||||
NULL))// envelope
|
||||
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_WindGust:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
6000 * js_ffmult->value, // magnitude
|
||||
1000, // period
|
||||
500, // duration
|
||||
18000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_WindShear:
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 1500000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 500000;
|
||||
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_SawtoothDown);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
10000 * js_ffmult->value, // magnitude
|
||||
80, // period
|
||||
2000, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
&envelope)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Pistol:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
8500 * js_ffmult->value, // magnitude
|
||||
130, // period
|
||||
50, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Shotgun:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
6000 * js_ffmult->value, // magnitude
|
||||
100, // period
|
||||
100, // duration
|
||||
18000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 100000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 100000;
|
||||
|
||||
g_pEffects[iSlotNum][1] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
0, // angle
|
||||
300, // duration
|
||||
7000 * js_ffmult->value, // magnitude
|
||||
&envelope))// envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Laser1:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
6000 * js_ffmult->value, // magnitude
|
||||
25, // period
|
||||
1000, // duration
|
||||
18000, // angle
|
||||
2000, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Laser2:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
5000 * js_ffmult->value, // magnitude
|
||||
25, // period
|
||||
1000, // duration
|
||||
0, // angle
|
||||
3000, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Laser3:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
5000 * js_ffmult->value, // magnitude
|
||||
25, // period
|
||||
1000, // duration
|
||||
9000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Laser4:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
7000 * js_ffmult->value, // magnitude
|
||||
25, // period
|
||||
1000, // duration
|
||||
9000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Laser5:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
5000 * js_ffmult->value, // magnitude
|
||||
25, // period
|
||||
1000, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Laser6:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
5000 * js_ffmult->value, // magnitude
|
||||
25, // period
|
||||
1000, // duration
|
||||
0, // angle
|
||||
2000, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_OutOfAmmo:
|
||||
g_pEffects[iSlotNum][0] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
18000, // angle
|
||||
10, // duration
|
||||
6000 * js_ffmult->value, // magnitude
|
||||
NULL))// envelope
|
||||
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_LightningGun:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
1500 * js_ffmult->value, // magnitude
|
||||
250, // period
|
||||
1000, // duration
|
||||
18000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
|
||||
success = FALSE;
|
||||
g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
6000 * js_ffmult->value, // magnitude
|
||||
50, // period
|
||||
1000, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Missile:
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 500000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 200000;
|
||||
|
||||
g_pEffects[iSlotNum][0] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
0, // angle
|
||||
250, // duration
|
||||
10000 * js_ffmult->value, // magnitude
|
||||
&envelope))// envelope
|
||||
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_GatlingGun:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_SawtoothDown);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
6000 * js_ffmult->value, // magnitude
|
||||
100, // period
|
||||
1000, // duration
|
||||
0, // angle
|
||||
1000, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_ShortPlasma:
|
||||
envelope.dwAttackLevel = 7000;
|
||||
envelope.dwAttackTime = 250000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 0;
|
||||
|
||||
g_pEffects[iSlotNum][0] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
0, // angle
|
||||
250, // duration
|
||||
0, // magnitude
|
||||
&envelope))// envelope
|
||||
|
||||
success = FALSE;
|
||||
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 0;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 250000;
|
||||
|
||||
g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
5000 * js_ffmult->value, // magnitude
|
||||
30, // period
|
||||
250, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
&envelope)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_PlasmaCannon1:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
5000 * js_ffmult->value, // magnitude
|
||||
500, // period
|
||||
400, // duration
|
||||
18000, // angle
|
||||
-5000, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
|
||||
success = FALSE;
|
||||
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 250000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 0;
|
||||
|
||||
g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
6000 * js_ffmult->value, // magnitude
|
||||
30, // period
|
||||
250, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
&envelope)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_PlasmaCannon2:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
4000 * js_ffmult->value, // magnitude
|
||||
1000, // period
|
||||
800, // duration
|
||||
18000, // angle
|
||||
-4000, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 500000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 0;
|
||||
|
||||
g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
8000 * js_ffmult->value, // magnitude
|
||||
35, // period
|
||||
500, // duration
|
||||
0, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
&envelope)) // envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
case fffx_Cannon:
|
||||
g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square);
|
||||
if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice,
|
||||
8000 * js_ffmult->value, // magnitude
|
||||
100, // period
|
||||
100, // duration
|
||||
18000, // angle
|
||||
0, // offset
|
||||
0, // phase
|
||||
NULL)) // envelope
|
||||
success = FALSE;
|
||||
|
||||
envelope.dwAttackLevel = 0;
|
||||
envelope.dwAttackTime = 100000;
|
||||
envelope.dwFadeLevel = 0;
|
||||
envelope.dwFadeTime = 100000;
|
||||
|
||||
g_pEffects[iSlotNum][1] = new CFeelConstant;
|
||||
if (!((CFeelConstant*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice,
|
||||
0, // angle
|
||||
300, // duration
|
||||
10000 * js_ffmult->value, // magnitude
|
||||
&envelope))// envelope
|
||||
success = FALSE;
|
||||
break;
|
||||
}// switch (fffx)
|
||||
|
||||
// if any effect in the compound failed to initialize, dump the lot
|
||||
if (!success)
|
||||
{
|
||||
for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++)
|
||||
{
|
||||
if (g_pEffects[iSlotNum][i])
|
||||
{
|
||||
delete g_pEffects[iSlotNum][i];
|
||||
g_pEffects[iSlotNum][i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
BOOL _FeelStartEffect(int iSlotNum, DWORD dwIterations, DWORD dwFlags)
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
|
||||
for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++)
|
||||
{
|
||||
if (g_pEffects[iSlotNum][i])
|
||||
{
|
||||
if (!g_pEffects[iSlotNum][i]->Start(dwIterations, dwFlags))
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
BOOL _FeelEffectPlaying(int iSlotNum)
|
||||
{
|
||||
DWORD dwFlags;
|
||||
dwFlags = 0;
|
||||
|
||||
// check to see if any effect within the compound is still playing
|
||||
for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++)
|
||||
{
|
||||
if (g_pEffects[iSlotNum][i])
|
||||
{
|
||||
g_pEffects[iSlotNum][i]->GetStatus(&dwFlags);
|
||||
if (dwFlags & FEELIT_FSTATUS_PLAYING)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL _FeelStopEffect(int iSlotNum)
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
|
||||
for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++)
|
||||
{
|
||||
if (g_pEffects[iSlotNum][i])
|
||||
{
|
||||
if (!g_pEffects[iSlotNum][i]->Stop())
|
||||
success = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
BOOL _FeelClearEffect(int iSlotNum)
|
||||
{
|
||||
for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++)
|
||||
{
|
||||
if (g_pEffects[iSlotNum][i])
|
||||
{
|
||||
delete g_pEffects[iSlotNum][i];
|
||||
g_pEffects[iSlotNum][i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
// Filename:- fffx_Feel.h (Force-Feedback FX)
|
||||
// ADDED BY IMMRESION
|
||||
|
||||
#ifndef FFFX_FEEL_H
|
||||
#define FFFX_FEEL_H
|
||||
|
||||
#include "../../client/fffx.h"
|
||||
#include "ffc.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
/* These functions were created to make the code a little easier to read.
|
||||
* _FeelCreateEffect is quite long since it needs to create different
|
||||
* kinds of effects. When playing effects, the number of iterations
|
||||
* may not act as expected. I can't use CFeelCompound effects since I
|
||||
* don't have a Project (which requires an ifr file at this point). So,
|
||||
* I simulate compound effects with arrays. If an effect has multiple
|
||||
* CFeelEffect in it, each CFeelEffect will be started individually with
|
||||
* that number of iterations. The only case where this will act strange
|
||||
* is when the CFeelEffects have different durations.
|
||||
*/
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
void _FeelInitEffects();
|
||||
BOOL _FeelCreateEffect(int iSlotNum, ffFX_e fffx, CFeelDevice* pFeelDevice);
|
||||
BOOL _FeelStartEffect(int iSlotNum, DWORD dwIterations, DWORD dwFlags);
|
||||
BOOL _FeelEffectPlaying(int iSlotNum);
|
||||
BOOL _FeelStopEffect(int iSlotNum);
|
||||
BOOL _FeelClearEffect(int iSlotNum);
|
||||
|
||||
#endif // #ifndef FFFX_FEEL_H
|
Loading…
Reference in a new issue