76 lines
2.1 KiB
C++
76 lines
2.1 KiB
C++
// Filename: geomSphere.h
|
|
// Created by: drose (01Oct99)
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef GEOMSPHERE_H
|
|
#define GEOMSPHERE_H
|
|
|
|
#include <pandabase.h>
|
|
|
|
#include "geom.h"
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Class : GeomSphere
|
|
// Description : A sphere primitive. This isn't actually a primitive
|
|
// under OpenGL (or probably most backends), but it's
|
|
// handy to be able to render a sphere from time to
|
|
// time, and it may be a primitive on some backends.
|
|
// This will render the best way the backend knows how
|
|
// to render a sphere.
|
|
//
|
|
// This structure contains a sequence of spheres. Each
|
|
// two consecutive vertices defines a sphere, where the
|
|
// first vertex represents the center, and the second
|
|
// vertex represents a point on the surface.
|
|
////////////////////////////////////////////////////////////////////
|
|
class EXPCL_PANDA GeomSphere : public Geom {
|
|
public:
|
|
GeomSphere() : Geom() { }
|
|
virtual Geom *make_copy() const;
|
|
virtual void print_draw_immediate() const { }
|
|
virtual void draw_immediate(GraphicsStateGuardianBase *gsg) const;
|
|
|
|
virtual int get_num_vertices_per_prim() const {
|
|
return 2;
|
|
}
|
|
virtual int get_num_more_vertices_than_components() const {
|
|
return 0;
|
|
}
|
|
virtual bool uses_components() const {
|
|
return false;
|
|
}
|
|
|
|
virtual int get_length(int) const {
|
|
return 2;
|
|
}
|
|
|
|
virtual Geom *explode() const {
|
|
return new GeomSphere(*this);
|
|
}
|
|
|
|
public:
|
|
static void register_with_read_factory(void);
|
|
|
|
static TypedWriteable *make_GeomSphere(const FactoryParams ¶ms);
|
|
|
|
public:
|
|
static TypeHandle get_class_type() {
|
|
return _type_handle;
|
|
}
|
|
static void init_type() {
|
|
Geom::init_type();
|
|
register_type(_type_handle, "GeomSphere",
|
|
Geom::get_class_type());
|
|
}
|
|
virtual TypeHandle get_type() const {
|
|
return get_class_type();
|
|
}
|
|
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
|
|
|
private:
|
|
static TypeHandle _type_handle;
|
|
};
|
|
|
|
#endif
|