mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-18 12:43:44 -04:00
pgraph decal
This commit is contained in:
parent
366bcf8520
commit
65395b9721
48
panda/src/pgraph/cullableObject.I
Normal file
48
panda/src/pgraph/cullableObject.I
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// Filename: cullableObject.I
|
||||||
|
// Created by: drose (04Mar02)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the Panda 3d
|
||||||
|
// Software license. You should have received a copy of this license
|
||||||
|
// along with this source code; you will also find a current copy of
|
||||||
|
// the license at http://www.panda3d.org/license.txt .
|
||||||
|
//
|
||||||
|
// To contact the maintainers of this program write to
|
||||||
|
// panda3d@yahoogroups.com .
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: CullableObject::Constructor
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE CullableObject::
|
||||||
|
CullableObject(CullableObject *next) :
|
||||||
|
_next(next)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: CullableObject::Copy Constructor
|
||||||
|
// Access: Private
|
||||||
|
// Description: CullableObjects should not be copied.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE CullableObject::
|
||||||
|
CullableObject(const CullableObject ©) {
|
||||||
|
nassertv(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: CullableObject::Copy Assignment Operator
|
||||||
|
// Access: Private
|
||||||
|
// Description: CullableObjects should not be copied.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE void CullableObject::
|
||||||
|
operator = (const CullableObject ©) {
|
||||||
|
nassertv(false);
|
||||||
|
}
|
48
panda/src/pgraph/cullableObject.cxx
Normal file
48
panda/src/pgraph/cullableObject.cxx
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// Filename: cullableObject.cxx
|
||||||
|
// Created by: drose (04Mar02)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the Panda 3d
|
||||||
|
// Software license. You should have received a copy of this license
|
||||||
|
// along with this source code; you will also find a current copy of
|
||||||
|
// the license at http://www.panda3d.org/license.txt .
|
||||||
|
//
|
||||||
|
// To contact the maintainers of this program write to
|
||||||
|
// panda3d@yahoogroups.com .
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "cullableObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
TypeHandle CullableObject::_type_handle;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: CullableObject::Destructor
|
||||||
|
// Access: Public
|
||||||
|
// Description: Automatically deletes the whole chain of these things.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
CullableObject::
|
||||||
|
~CullableObject() {
|
||||||
|
if (_next != (CullableObject *)NULL) {
|
||||||
|
delete _next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: CullableObject::output
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void CullableObject::
|
||||||
|
output(ostream &out) const {
|
||||||
|
if (_geom != (Geom *)NULL) {
|
||||||
|
out << *_geom;
|
||||||
|
} else {
|
||||||
|
out << "(null)";
|
||||||
|
}
|
||||||
|
}
|
74
panda/src/pgraph/cullableObject.h
Normal file
74
panda/src/pgraph/cullableObject.h
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// Filename: cullableObject.h
|
||||||
|
// Created by: drose (04Mar02)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the Panda 3d
|
||||||
|
// Software license. You should have received a copy of this license
|
||||||
|
// along with this source code; you will also find a current copy of
|
||||||
|
// the license at http://www.panda3d.org/license.txt .
|
||||||
|
//
|
||||||
|
// To contact the maintainers of this program write to
|
||||||
|
// panda3d@yahoogroups.com .
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef CULLABLEOBJECT_H
|
||||||
|
#define CULLABLEOBJECT_H
|
||||||
|
|
||||||
|
#include "pandabase.h"
|
||||||
|
|
||||||
|
#include "geom.h"
|
||||||
|
#include "renderState.h"
|
||||||
|
#include "transformState.h"
|
||||||
|
#include "pointerTo.h"
|
||||||
|
#include "referenceCount.h"
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Class : CullableObject
|
||||||
|
// Description : The smallest atom of cull. This is normally just a
|
||||||
|
// Geom and its associated state, but it also represent
|
||||||
|
// a number of Geoms to be drawn together, with a number
|
||||||
|
// of Geoms decalled onto them.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
class EXPCL_PANDA CullableObject {
|
||||||
|
public:
|
||||||
|
INLINE CullableObject(CullableObject *next = NULL);
|
||||||
|
|
||||||
|
private:
|
||||||
|
INLINE CullableObject(const CullableObject ©);
|
||||||
|
INLINE void operator = (const CullableObject ©);
|
||||||
|
|
||||||
|
public:
|
||||||
|
~CullableObject();
|
||||||
|
|
||||||
|
void output(ostream &out) const;
|
||||||
|
|
||||||
|
PT(Geom) _geom;
|
||||||
|
CPT(RenderState) _state;
|
||||||
|
CPT(TransformState) _transform;
|
||||||
|
CullableObject *_next;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static TypeHandle get_class_type() {
|
||||||
|
return _type_handle;
|
||||||
|
}
|
||||||
|
static void init_type() {
|
||||||
|
register_type(_type_handle, "CullableObject");
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static TypeHandle _type_handle;
|
||||||
|
};
|
||||||
|
|
||||||
|
INLINE ostream &operator << (ostream &out, const CullableObject &object) {
|
||||||
|
object.output(out);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "cullableObject.I"
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user