mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Skeleton classes
This commit is contained in:
parent
834e06d5d4
commit
4c5c11c0c8
27
panda/src/skel/Sources.pp
Normal file
27
panda/src/skel/Sources.pp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
|
||||||
|
dtoolutil:c dtoolbase:c dtool:m prc:c
|
||||||
|
|
||||||
|
#define USE_PACKAGES
|
||||||
|
|
||||||
|
#begin lib_target
|
||||||
|
#define TARGET skel
|
||||||
|
#define LOCAL_LIBS \
|
||||||
|
display text pgraph gobj linmath putil
|
||||||
|
|
||||||
|
#define COMBINED_SOURCES $[TARGET]_composite1.cxx
|
||||||
|
|
||||||
|
#define SOURCES \
|
||||||
|
config_skel.h \
|
||||||
|
basicSkel.I basicSkel.h
|
||||||
|
|
||||||
|
#define INCLUDED_SOURCES \
|
||||||
|
config_skel.cxx \
|
||||||
|
basicSkel.cxx
|
||||||
|
|
||||||
|
#define INSTALL_HEADERS \
|
||||||
|
basicSkel.h basicSkel.I
|
||||||
|
|
||||||
|
#define IGATESCAN all
|
||||||
|
|
||||||
|
#end lib_target
|
||||||
|
|
56
panda/src/skel/basicSkel.I
Normal file
56
panda/src/skel/basicSkel.I
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// Filename: basicSkel.I
|
||||||
|
// Created by: jyelon (31Jan07)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ .
|
||||||
|
//
|
||||||
|
// To contact the maintainers of this program write to
|
||||||
|
// panda3d-general@lists.sourceforge.net .
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: BasicSkel::Constructor
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE BasicSkel::
|
||||||
|
BasicSkel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: BasicSkel::Destructor
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE BasicSkel::
|
||||||
|
~BasicSkel() {
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: BasicSkel::set_value
|
||||||
|
// Access: Public
|
||||||
|
// Description: Stores an integer value.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE void BasicSkel::
|
||||||
|
set_value(int n) {
|
||||||
|
_value = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: BasicSkel::get_value
|
||||||
|
// Access: Public
|
||||||
|
// Description: Retreives a value that was previously stored.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
INLINE int BasicSkel::
|
||||||
|
get_value() {
|
||||||
|
return _value;
|
||||||
|
}
|
43
panda/src/skel/basicSkel.cxx
Normal file
43
panda/src/skel/basicSkel.cxx
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
// Filename: basicSkel.cxx
|
||||||
|
// Created by: jyelon (31Jan07)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ .
|
||||||
|
//
|
||||||
|
// To contact the maintainers of this program write to
|
||||||
|
// panda3d-general@lists.sourceforge.net .
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "basicSkel.h"
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: BasicSkel::set_value_alt
|
||||||
|
// Access: Public
|
||||||
|
// Description: Stores an integer value. Exact same functionality
|
||||||
|
// as set_value, except that this isn't an inline
|
||||||
|
// function.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void BasicSkel::
|
||||||
|
set_value_alt(int n) {
|
||||||
|
_value = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: BasicSkel::get_value
|
||||||
|
// Access: Public
|
||||||
|
// Description: Retreives a value that was previously stored.
|
||||||
|
// Exact same functionality as get_value, except
|
||||||
|
// that this isn't an inline function.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
int BasicSkel::
|
||||||
|
get_value_alt() {
|
||||||
|
return _value;
|
||||||
|
}
|
53
panda/src/skel/basicSkel.h
Normal file
53
panda/src/skel/basicSkel.h
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
// Filename: basicSkel.h
|
||||||
|
// Created by: jyelon (31Jan07)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ .
|
||||||
|
//
|
||||||
|
// To contact the maintainers of this program write to
|
||||||
|
// panda3d-general@lists.sourceforge.net .
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef BASICSKEL_H
|
||||||
|
#define BASICSKEL_H
|
||||||
|
|
||||||
|
#include "pandabase.h"
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Class : BasicSkel
|
||||||
|
// Description : This is the most basic of the skeleton classes.
|
||||||
|
// It stores an integer, and will return it on request.
|
||||||
|
//
|
||||||
|
// The skeleton classes are intended to help you learn
|
||||||
|
// how to add C++ classes to panda. See also the manual,
|
||||||
|
// "Adding C++ Classes to Panda."
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
class EXPCL_PANDASKEL BasicSkel {
|
||||||
|
PUBLISHED:
|
||||||
|
INLINE BasicSkel();
|
||||||
|
INLINE ~BasicSkel();
|
||||||
|
|
||||||
|
// These inline functions allow you to get and set _value.
|
||||||
|
INLINE void set_value(int n);
|
||||||
|
INLINE int get_value();
|
||||||
|
|
||||||
|
// These do the same thing as the functions above.
|
||||||
|
void set_value_alt(int n);
|
||||||
|
int get_value_alt();
|
||||||
|
|
||||||
|
private:
|
||||||
|
int _value;
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "basicSkel.I"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
51
panda/src/skel/config_skel.cxx
Normal file
51
panda/src/skel/config_skel.cxx
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// Filename: config_skel.cxx
|
||||||
|
// Created by: jyelon (09Feb07)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ .
|
||||||
|
//
|
||||||
|
// To contact the maintainers of this program write to
|
||||||
|
// panda3d-general@lists.sourceforge.net .
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "config_skel.h"
|
||||||
|
#include "dconfig.h"
|
||||||
|
|
||||||
|
Configure(config_skel);
|
||||||
|
NotifyCategoryDef(skel, "");
|
||||||
|
|
||||||
|
ConfigureFn(config_skel) {
|
||||||
|
init_libskel();
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigVariableInt skel_number_of_monkeys
|
||||||
|
("skel-sample-config-variable", 3);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: init_libskel
|
||||||
|
// Description: Initializes the library. This must be called at
|
||||||
|
// least once before any of the functions or classes in
|
||||||
|
// this library can be used. Normally it will be
|
||||||
|
// called by the static initializers and need not be
|
||||||
|
// called explicitly, but special cases exist.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void
|
||||||
|
init_libskel() {
|
||||||
|
static bool initialized = false;
|
||||||
|
if (initialized) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
initialized = true;
|
||||||
|
|
||||||
|
// There's no initialization necessary for the skel library.
|
||||||
|
// But if there were, we would put it here.
|
||||||
|
}
|
||||||
|
|
36
panda/src/skel/config_skel.h
Normal file
36
panda/src/skel/config_skel.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// Filename: config_skel.h
|
||||||
|
// Created by: jyelon (09Feb07)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) 2001 - 2004, 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://etc.cmu.edu/panda3d/docs/license/ .
|
||||||
|
//
|
||||||
|
// To contact the maintainers of this program write to
|
||||||
|
// panda3d-general@lists.sourceforge.net .
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef CONFIG_SKEL_H
|
||||||
|
#define CONFIG_SKEL_H
|
||||||
|
|
||||||
|
#include "pandabase.h"
|
||||||
|
#include "notifyCategoryProxy.h"
|
||||||
|
#include "configVariableDouble.h"
|
||||||
|
#include "configVariableString.h"
|
||||||
|
#include "configVariableInt.h"
|
||||||
|
|
||||||
|
NotifyCategoryDecl(skel, EXPCL_PANDASKEL, EXPTP_PANDASKEL);
|
||||||
|
|
||||||
|
extern ConfigVariableInt skel_sample_config_variable;
|
||||||
|
|
||||||
|
extern EXPCL_PANDASKEL void init_libskel();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
1
panda/src/skel/skel_composite.cxx
Normal file
1
panda/src/skel/skel_composite.cxx
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "skel_composite1.cxx"
|
2
panda/src/skel/skel_composite1.cxx
Normal file
2
panda/src/skel/skel_composite1.cxx
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#include "config_skel.cxx"
|
||||||
|
#include "basicSkel.cxx"
|
Loading…
x
Reference in New Issue
Block a user