www.pudn.com > j3dme-0.3.0.rar > Model.java


/*
 * J3DME Fast 3D software rendering for small devices
 * Copyright (C) 2001 Onno Hommes
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package net.jscience.j3dme;

/**
 * This class represents an object in the 3D world. A model
 * has a geometry defining its shape, a location and three orientation
 * paratmeters. The orientation can be set by pitch, yaw and rol.
 */
public class Model
{
  protected Geometry geometry;

  /**
   * The yaw attitude of the model. This is the clock wise
   * rotation of the model around the y-axis.
   */
  public int yaw = 0;

  /**
   * The pitch attitude of the model. This is the clock wise
   * rotation of the model around the x-axis.
   */
  public int pitch = 0;

  /**
   * The roll attitude of the model. This is the clock wise
   * rotation of the model around the z-axis.
   */
  public int roll = 0;

  /**
   * The x component of the model's coordinate location.
   */
  public int x = 0;

  /**
   * The y component of the model's coordinate location.
   */
  public int y = 0;

 /**
   * The z component of the model's coordinate location.
   */
  public int z = 0;

 /**
   * The size component of the model. Not Used
   */
  public int size = 256;

  /**
   * Return a model with the supplied geometry

* @param g The geomtery for the model object * @return A model object. */ public Model(Geometry g){ geometry = g; } public Model(){ } /** * Return the Geometry of the model

* @return The Geometry object of the model * @ see Wireframe */ public Geometry getGeometry(){ return geometry; } /** * Return the Geometry of the model

* @param g The geometry to set on the model * @ see Wireframe */ public void setGeometry(Geometry g){ geometry = g; } }