Пример #1
0
void			neb::phx::core::actor::base::init(parent_t * const & p)
{
	printv_func(DEBUG);
	
	create_physics();
	init_physics();
}
Пример #2
0
void			phx::core::scene::base::init() {

    BOOST_LOG_CHANNEL_SEV(lg, "phx core scene", debug) << __PRETTY_FUNCTION__;

    neb::core::scene::base::init();

    create_physics();
}
Пример #3
0
void				THIS::init(parent_t * const & p)
{
	printf("%s\n", __PRETTY_FUNCTION__);
	printv_func(DEBUG);

	setParent(p);

	create_physics();
}
Пример #4
0
void				THIS::create_physics()
{
	printv_func(DEBUG);

	auto fnd_app = get_fnd_app();
	
	if(!fnd_app->is_valid()) return;

	auto actor = neb::could_be<parent_t, neb::phx::core::actor::base>(getParent());
	assert(actor);

	if(px_shape_) return;

	if(actor) {
		auto rigidactor = actor->isPxActorRigidActorBase();//std::dynamic_pointer_cast<neb::fnd::actor::Rigid_Actor>(parent_.lock());

		assert(rigidactor);

		if(rigidactor) {
			if(!rigidactor->px_actor_) rigidactor->create_physics();
			assert(rigidactor->px_actor_);

			auto px_rigidactor = rigidactor->px_actor_->isRigidActor();
			assert(px_rigidactor);

			physx::PxMaterial* px_mat[2];

			auto app = dynamic_cast<neb::phx::app::base*>(get_fnd_app());
			assert(app);

			px_mat[0] = app->px_physics_->createMaterial(1,1,1);
			px_mat[1] = app->px_physics_->createMaterial(1,1,1);

			px_shape_ = px_rigidactor->createShape(*(to_geo()), px_mat, 2);
		}
	}
}
Пример #5
0
void				THIS::__init(THIS::parent_t * const & p)
{
	printv_func(DEBUG);

	create_physics();
}