Package soc.qase.file.bsp

Source Code of soc.qase.file.bsp.BSPPlane

//---------------------------------------------------------------------
// Name:      BSPPlane.java
// Author:      Bernard.Gorman@computing.dcu.ie
//---------------------------------------------------------------------

package soc.qase.file.bsp;

import soc.qase.tools.Utils;
import soc.qase.tools.vecmath.Vector3f;

/*-------------------------------------------------------------------*/
/** Wrapper class for Planes in the BSP file. These are generic geometric
*  planes used to recursively split the environment; they are in turn
*  referenced by nodes, faces and brush sides.
@see BSPPlaneLump
@see BSPNode
@see BSPBrushSide */
/*-------------------------------------------------------------------*/
public class BSPPlane
{
  public long type;
  public float distance;
  public Vector3f normal = null;

/*-------------------------------------------------------------------*/
/**  Constructor. Builds a BSPPlane from raw byte data.
@param planeData byte array containing plane lump data
@param offset location of the plane in the byte array */
/*-------------------------------------------------------------------*/
  public BSPPlane(byte[] planeData, int offset)
  {
    normal = new Vector3f(Utils.floatValue(planeData, offset), Utils.floatValue(planeData, offset + 4), Utils.floatValue(planeData, offset + 8));
    distance = Utils.floatValue(planeData, offset + 12);
    type = Utils.unsignedIntValue(planeData, offset + 16);
  }
}

TOP

Related Classes of soc.qase.file.bsp.BSPPlane

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.