Jump to content

Publish the project.


photo

Recommended Posts

Posted

Okay, thank you 

How to make a rut? That's the tank wheels left grooves in the ground.

Posted

How can I change the material of the node in the way of code?

 

Posted

hello 

Use the material::load function to always report errors.The display pointer is empty

 

Posted

Very simple code

Load(),I want to know how to use this function.

I want to change the node material by loading disk files.

QQ截图20191011203840.png

Posted

The error "pointer is empty" occurs because you're calling method without creating a material instance. To load material you first need to create it:

ballmat = Material::create();
ballmat->load(...); 

 

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

How to detect collision with objectmeshcutter?

Using a   getNumContacts()   function does not collide with it.

image.thumb.png.09e3b97acd615298d169d71c315384c8.png

Posted

How to make such a large DDS file?
This DDS is in your planting.
I can't open it, even if I use the DDS plug-in of PS.

image.thumb.png.a22136a27260c9f6211858cc9bc625dc.png

Posted (edited)

Creating Mesh Clusters from Mesh Clutters

How can I use C + + to implement this function?Call this function with code

and How to set the bounding box of an object?

Edited by 908317477
Posted

Hello @908317477

ObjectMeshClusterPtr createFrom(const ObjectMeshClutterPtr &clutter)
{
	auto cluster = ObjectMeshCluster::create(clutter->getMeshName());
	String name(clutter->getName());
	cluster->setName(name.append("_Cluster"));
	cluster->setParent(clutter->getParent());
	cluster->setWorldTransform(clutter->getWorldTransform());
	cluster->setVisibleDistance(clutter->getVisibleDistance());
	cluster->setFadeDistance(clutter->getFadeDistance());

	const int suf_num = clutter->getNumSurfaces();
	for (int suf_index = 0; suf_index < suf_num; ++suf_index)
	{
		cluster->setEnabled           (clutter->isEnabled            (suf_index), suf_index);
		cluster->setViewportMask      (clutter->getViewportMask      (suf_index), suf_index);
		cluster->setShadowMask        (clutter->getShadowMask        (suf_index), suf_index);
		cluster->setCastShadow        (clutter->getCastShadow        (suf_index), suf_index);
		cluster->setCastWorldShadow   (clutter->getCastWorldShadow   (suf_index), suf_index);
		cluster->setBakeToEnvProbe    (clutter->getBakeToEnvProbe    (suf_index), suf_index);
		cluster->setBakeToVoxelProbe  (clutter->getBakeToVoxelProbe  (suf_index), suf_index);
		cluster->setCastEnvProbeShadow(clutter->getCastEnvProbeShadow(suf_index), suf_index);
		cluster->setShadowMode        (clutter->getShadowMode        (suf_index), suf_index);
		cluster->setMinVisibleDistance(clutter->getMinVisibleDistance(suf_index), suf_index);
		cluster->setMaxVisibleDistance(clutter->getMaxVisibleDistance(suf_index), suf_index);
		cluster->setMinFadeDistance   (clutter->getMinFadeDistance   (suf_index), suf_index);
		cluster->setMaxFadeDistance   (clutter->getMaxFadeDistance   (suf_index), suf_index);
		cluster->setIntersection      (clutter->getIntersection      (suf_index), suf_index);
		cluster->setIntersectionMask  (clutter->getIntersectionMask  (suf_index), suf_index);
		cluster->setCollision         (clutter->getCollision         (suf_index), suf_index);
		cluster->setCollisionMask     (clutter->getCollisionMask     (suf_index), suf_index);
		cluster->setSoundOcclusion    (clutter->getSoundOcclusion    (suf_index), suf_index);
		cluster->setSoundOcclusionMask(clutter->getSoundOcclusionMask(suf_index), suf_index);
		cluster->setPhysicsFriction   (clutter->getPhysicsFriction   (suf_index), suf_index);
		cluster->setPhysicsRestitution(clutter->getPhysicsRestitution(suf_index), suf_index);
		cluster->setMaterial          (clutter->getMaterial          (suf_index), suf_index);
		cluster->setSurfaceProperty   (clutter->getSurfaceProperty   (suf_index), suf_index);
	}

	Vector<Mat4> transforms;
	clutter->createClutterTransforms();
	if (!clutter->getClutterWorldTransforms(transforms))
	{
		return ObjectMeshClusterPtr{};
	}
	cluster->createMeshes(transforms);
	return cluster;
}

 

Posted

When I call this function, my trees don't show up.

detachClusterWorldTransforms()
 
image.png.fd6d5cc8039b85592e93d056388080dc.png
×
×
  • Create New...