aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2005-01-14 16:14:02 +0000
committerCarsten Weisse <[email protected]>2005-01-14 16:14:02 +0000
commitf81da5f4ecebb9ef5c283389b41c0a72889f64ae (patch)
tree4fc0e60bf3d3fdb3decdac08d876f8822fdaedc2 /src
parentcff7dca2b76c9a5e18fc72c28665f8b918b2e9cc (diff)
clear() added
Diffstat (limited to 'src')
-rw-r--r--src/jake2/game/cplane_t.java30
-rw-r--r--src/jake2/game/trace_t.java20
-rw-r--r--src/jake2/server/moveclip_t.java16
3 files changed, 42 insertions, 24 deletions
diff --git a/src/jake2/game/cplane_t.java b/src/jake2/game/cplane_t.java
index 4465a76..e356448 100644
--- a/src/jake2/game/cplane_t.java
+++ b/src/jake2/game/cplane_t.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: cplane_t.java,v 1.3 2004-07-08 20:24:29 hzi Exp $
+// $Id: cplane_t.java,v 1.4 2005-01-14 16:08:12 cawe Exp $
package jake2.game;
@@ -33,23 +33,8 @@ public class cplane_t
public byte type; // for fast side tests
public byte signbits; // signx + (signy<<1) + (signz<<1)
public byte pad[] = { 0, 0 };
-
-// public cplane_t getClone()
-// {
-// cplane_t out = new cplane_t();
-// Math3D.set(out.normal, normal);
-// out.dist = dist;
-// out.type = type;
-// out.signbits = signbits;
-// out.pad[0] = pad[0];
-// out.pad[1] = pad[1];
-//
-// return out;
-// }
-
- public void set(cplane_t c)
- {
-
+
+ public void set(cplane_t c) {
Math3D.set(normal, c.normal);
dist = c.dist;
type = c.type;
@@ -57,4 +42,13 @@ public class cplane_t
pad[0] = c.pad[0];
pad[1] = c.pad[1];
}
+
+ public void clear() {
+ Math3D.VectorClear(normal);
+ dist = 0;
+ type = 0;
+ signbits = 0;
+ pad[0] = 0;
+ pad[1] = 0;
+ }
}
diff --git a/src/jake2/game/trace_t.java b/src/jake2/game/trace_t.java
index 420a344..358e6f4 100644
--- a/src/jake2/game/trace_t.java
+++ b/src/jake2/game/trace_t.java
@@ -19,14 +19,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 31.10.2003 by RST.
-// $Id: trace_t.java,v 1.4 2004-07-12 20:47:01 hzi Exp $
+// $Id: trace_t.java,v 1.5 2005-01-14 16:09:42 cawe Exp $
package jake2.game;
import jake2.util.Math3D;
//a trace is returned when a box is swept through the world
-public class trace_t implements Cloneable {
+public class trace_t {
public boolean allsolid; // if true, plane is not valid
public boolean startsolid; // if true, the initial point was in a solid area
public float fraction; // time completed, 1.0 = didn't hit anything
@@ -38,9 +38,8 @@ public class trace_t implements Cloneable {
public int contents; // contents on other side of surface hit
// pointer
public edict_t ent; // not set by CM_*() functions
-
- public void set(trace_t from)
- {
+
+ public void set(trace_t from) {
allsolid = from.allsolid;
startsolid = from.allsolid;
fraction = from.fraction;
@@ -50,4 +49,15 @@ public class trace_t implements Cloneable {
contents = from.contents;
ent = from.ent;
}
+
+ public void clear() {
+ allsolid = false;
+ startsolid = false;
+ fraction = 0;
+ Math3D.VectorClear(endpos);
+ plane.clear();
+ surface = null;
+ contents = 0;
+ ent = null;
+ }
}
diff --git a/src/jake2/server/moveclip_t.java b/src/jake2/server/moveclip_t.java
index 7bec554..3a336af 100644
--- a/src/jake2/server/moveclip_t.java
+++ b/src/jake2/server/moveclip_t.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 09.12.2003 by RST.
-// $Id: moveclip_t.java,v 1.1 2004-07-07 19:59:50 hzi Exp $
+// $Id: moveclip_t.java,v 1.2 2005-01-14 16:14:02 cawe Exp $
package jake2.server;
@@ -30,6 +30,7 @@ import jake2.game.*;
import jake2.qcommon.*;
import jake2.render.*;
import jake2.server.*;
+import jake2.util.Math3D;
public class moveclip_t
{
@@ -41,4 +42,17 @@ public class moveclip_t
trace_t trace = new trace_t();
edict_t passedict;
int contentmask;
+
+ public void clear() {
+ Math3D.VectorClear(boxmins);
+ Math3D.VectorClear(boxmaxs);
+ Math3D.VectorClear(mins);
+ Math3D.VectorClear(maxs);
+ Math3D.VectorClear(mins2);
+ Math3D.VectorClear(maxs2);
+ start = end = null;
+ trace.clear();
+ passedict = null;
+ contentmask = 0;
+ }
}