mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
Add ability to persist ghost nodes.
This commit is contained in:
parent
a9f3940577
commit
cc4701d299
@ -171,3 +171,27 @@ do_sync_b2p() {
|
||||
_sync_disable = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells the BamReader how to create objects of type BulletGhostNode.
|
||||
*/
|
||||
void BulletGhostNode::
|
||||
register_with_read_factory() {
|
||||
BamReader::get_factory()->register_factory(get_class_type(), make_from_bam);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called by the BamReader's factory when a new object of
|
||||
* this type is encountered in the Bam file. It should create the ghost node.
|
||||
*/
|
||||
TypedWritable *BulletGhostNode::
|
||||
make_from_bam(const FactoryParams ¶ms) {
|
||||
BulletGhostNode *param = new BulletGhostNode;
|
||||
DatagramIterator scan;
|
||||
BamReader *manager;
|
||||
|
||||
parse_params(params, scan, manager);
|
||||
param->fillin(scan, manager);
|
||||
|
||||
return param;
|
||||
}
|
||||
|
@ -59,6 +59,12 @@ private:
|
||||
|
||||
void do_transform_changed();
|
||||
|
||||
public:
|
||||
static void register_with_read_factory();
|
||||
|
||||
protected:
|
||||
static TypedWritable *make_from_bam(const FactoryParams ¶ms);
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
|
@ -189,6 +189,7 @@ init_libbullet() {
|
||||
BulletDebugNode::register_with_read_factory();
|
||||
BulletPlaneShape::register_with_read_factory();
|
||||
BulletRigidBodyNode::register_with_read_factory();
|
||||
BulletGhostNode::register_with_read_factory();
|
||||
BulletSphereShape::register_with_read_factory();
|
||||
BulletTriangleMesh::register_with_read_factory();
|
||||
BulletTriangleMeshShape::register_with_read_factory();
|
||||
|
Loading…
x
Reference in New Issue
Block a user