aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/jake2/game')
-rw-r--r--src/jake2/game/cplane_t.java30
-rw-r--r--src/jake2/game/trace_t.java20
2 files changed, 27 insertions, 23 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;
+ }
}