[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src world.hh,1.37,1.38
From: |
Daniel Heck <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src world.hh,1.37,1.38 |
Date: |
Thu, 20 Nov 2003 20:27:08 +0000 |
Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv4475/src
Modified Files:
world.hh
Log Message:
- Added SetConstantForce(), KillActor()
Index: world.hh
===================================================================
RCS file: /cvsroot/enigma/enigma/src/world.hh,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** world.hh 9 Nov 2003 11:47:30 -0000 1.37
--- world.hh 20 Nov 2003 20:27:06 -0000 1.38
***************
*** 39,53 ****
using std::string;
- }
! namespace world
! {
! /*
! ** ActorInfo
! **
! ** This class contains the information the physics engine maintains
! ** about dynamic objects ("actors").
! */
class ActorInfo {
public:
--- 39,50 ----
using std::string;
!
! /* -------------------- ActorInfo -------------------- */
! /*!
! * This class contains the information the physics engine
! * maintains about dynamic objects ("actors").
! */
class ActorInfo {
public:
***************
*** 77,83 ****
};
! /* Impulse is used to transfer force from one Object to another
! Object (currently only Stones can be the destination of
! Impulses). */
struct Impulse {
Object *sender;
--- 74,82 ----
};
! /*!
! * Impulse is used to transfer force from one Object to another
! * Object (currently only Stones can be the destination of
! * Impulses).
! */
struct Impulse {
Object *sender;
***************
*** 90,94 ****
};
! /* Things that may happen when an actor hits a stone. */
enum StoneResponse {
STONE_PASS, // Actor passes stone
--- 89,93 ----
};
! /*! Things that may happen when an actor hits a stone. */
enum StoneResponse {
STONE_PASS, // Actor passes stone
***************
*** 96,101 ****
};
! /* This structure stores all the information that is necessary to
! handle collisions between stones and actors. */
struct StoneContact
{
--- 95,102 ----
};
! /*!
! * This structure stores all the information that is necessary to
! * handle collisions between stones and actors.
! */
struct StoneContact
{
***************
*** 159,163 ****
//----------------------------------------------------------------------
-
/* -------------------- World Management -------------------- */
--- 160,163 ----
***************
*** 196,230 ****
void SetMouseForce (V2 f);
/* -------------------- Rubbers Bands -------------------- */
! /* Add a rubber band that connects an actor with either a stone or
! another actor. `strength' is the force constant, and `length'
! is the natural length of the elastic: if it is shorter than
! `length' it will exert no force on the actor(s). */
void AddRubberBand (Actor *a, Stone *st, double strength, double length);
void AddRubberBand (Actor *a, Actor *a2, double strength, double length);
! /* Remove the rubber band between `a' and `st'. If `st' is 0, all
! rubber bands connecting `a' to a stone will be cut. */
void KillRubberBand (Actor *a, Stone *st);
! /* Remove the rubber band between `a' and `a2'. If `a2' is 0, all
! rubber bands connecting `a' to other actors will be cut. */
void KillRubberBand (Actor *a, Actor *a2);
! /* Remove all rubber bands attached to stone ST. */
void KillRubberBands (Stone *st);
! /* Fills given vector with basic info about rubbers attached to given
stone */
! struct Rubber_Band_Info {
! Actor *act;
! double length;
! double strength;
! };
! typedef std::vector<Rubber_Band_Info> RBI_vector;
void GiveRubberBands (Stone *st, RBI_vector &rubbers);
! /* Returns true if there already is a rubber band connecting `a'
! and `st'. */
bool HasRubberBand (Actor *a, Stone *st);
--- 196,236 ----
void SetMouseForce (V2 f);
+ void SetConstantForce (V2 force);
+
+
/* -------------------- Rubbers Bands -------------------- */
! struct Rubber_Band_Info {
! Actor *act;
! double length;
! double strength;
! };
! typedef std::vector<Rubber_Band_Info> RBI_vector;
!
!
! /*! Add a rubber band that connects an actor with either a stone
! or another actor. `strength' is the force constant, and
! `length' is the natural length of the elastic: if it is shorter
! than `length' it will exert no force on the actor(s). */
void AddRubberBand (Actor *a, Stone *st, double strength, double length);
void AddRubberBand (Actor *a, Actor *a2, double strength, double length);
! /*! Remove the rubber band between `a' and `st'. If `st' is 0,
! all rubber bands connecting `a' to a stone will be cut. */
void KillRubberBand (Actor *a, Stone *st);
! /*! Remove the rubber band between `a' and `a2'. If `a2' is 0,
! all rubber bands connecting `a' to other actors will be cut. */
void KillRubberBand (Actor *a, Actor *a2);
! /*! Remove all rubber bands attached to stone ST. */
void KillRubberBands (Stone *st);
! /*! Fills given vector with basic info about rubbers attached to
! given stone */
void GiveRubberBands (Stone *st, RBI_vector &rubbers);
! /*! Returns true if there already is a rubber band connecting `a'
! and `st'. */
bool HasRubberBand (Actor *a, Stone *st);
***************
*** 235,238 ****
--- 241,245 ----
+
/* -------------------- Signals & Messages -------------------- */
***************
*** 246,270 ****
void SendMessage(Object *o, const string &msg, const enigma::Value&
value);
! /* This function is used by all triggers, switches etc. that
! perform some particular action when activated (like opening
! doors or switching lasers on and off). It interprets the
! "action" and "target" attributes of `o'. */
void PerformAction(Object *o, bool onoff);
/* -------------------- Actors -------------------- */
void AddActor(double x, double y, Actor* a);
Actor *YieldActor(Actor *a);
void WarpActor(Actor *a, double newx, double newy, bool keep_velocity);
! void FastRespawnActor(Actor *a, bool keep_velocity); // like WarpActor
but goes to respawnpos
! void RespawnActor(Actor *a); // like FastRespawnActor but marble
'appears'
! bool ExchangeMarbles(Actor *marble1); // searches for other marble +
exchanges them
! Actor *FindOtherMarble(Actor *thisMarble); // (ac-whiteball <->
ac-blackball)
void GrabActor(Actor *a);
void ReleaseActor(Actor *a);
! // Find all actors at most RANGE units away from CENTER. Returns false
if none were found.
bool GetActorsInRange(px::V2 center, double range, std::vector<Actor*>
&actors);
! // Find all actors that are inside 'pos'. Returns false if none were
found.
bool GetActorsInsideField(const GridPos& pos, std::vector<Actor*>&
actors);
--- 253,296 ----
void SendMessage(Object *o, const string &msg, const enigma::Value&
value);
! /*! This function is used by all triggers, switches etc. that
! perform some particular action when activated (like opening
! doors or switching lasers on and off). It interprets the
! "action" and "target" attributes of `o'. */
void PerformAction(Object *o, bool onoff);
+
/* -------------------- Actors -------------------- */
void AddActor(double x, double y, Actor* a);
Actor *YieldActor(Actor *a);
+ void KillActor (Actor *a);
+
void WarpActor(Actor *a, double newx, double newy, bool keep_velocity);
!
! /*! Move `a' to its respawnpos immediately; do not run an
! animation like `RespawnActor(a)' would. */
! void FastRespawnActor(Actor *a, bool keep_velocity);
!
! /*! Like FastRespawnActor but marble 'appears' by running an
! animation. */
! void RespawnActor(Actor *a);
!
! /*! Find the marble of the other color (ac-whiteball <->
! ac-blackball). */
! Actor *FindOtherMarble(Actor *thisMarble);
!
! /*! Searches for other marble and exchanges their positions.
! Returns false if no other marble could be found. */
! bool ExchangeMarbles(Actor *marble1);
!
void GrabActor(Actor *a);
void ReleaseActor(Actor *a);
! /*! Find all actors at most RANGE units away from CENTER. Returns
! false if none were found. */
bool GetActorsInRange(px::V2 center, double range, std::vector<Actor*>
&actors);
!
! /*! Find all actors that are inside 'pos'. Returns false if none
! were found. */
bool GetActorsInsideField(const GridPos& pos, std::vector<Actor*>&
actors);
***************
*** 307,311 ****
/* -------------------- Explosions -------------------- */
! enum ExplosionType { DYNAMITE, BLACKBOMB, WHITEBOMB, BOMBSTONE };
void SendExplosionEffect(GridPos p, ExplosionType type);
}
--- 333,342 ----
/* -------------------- Explosions -------------------- */
! enum ExplosionType {
! DYNAMITE,
! BLACKBOMB,
! WHITEBOMB,
! BOMBSTONE,
! };
void SendExplosionEffect(GridPos p, ExplosionType type);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src world.hh,1.37,1.38,
Daniel Heck <address@hidden> <=