Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Static collision box

Des
Guest
Quote
2023-03-15 23:36:54

Hello all who can pls show me how to set an appropriate measurement static collision box to a static
animated object like a tree


Guest
Guest
Quote
2023-03-16 01:37:41

Here's an example:

https://files.catbox.moe/zqqojn....

Basically you make a tree as a static mesh.

Clone it is as an animated mesh.

Distribute an instance of it around your terrain.

Take your static mesh tree and apply an alpha texture to all it materials.

Parent the invisible "collision mesh" to the animated trees and set their positions to 0 to align with the animated tree's position.

Voila! You have collision.

Note: I don't use CC's terrain for anything so there may be a better way to do this.


just_in_case
Moderator
Quote
2023-03-16 02:37:12

Right, click on your static 3D model and go to modify and convert it into a static animated mesh.
once you have converted it into a static animated mesh, you need to go to your animation editior, in the animation editor your will see a dropdown at the top with the name of animated mesh, Simply select the name of the "static animated mesh" from the drop-down, and then in the animation editor viewport right click and select " create instance" it will create a new object in your 3D scene with the animated mesh, now you can also right click again in the animation editor and can add a static collision box as well.

ragarding the distribution on terrain, then yeah only animated mesh has this option to get distributed on the terrain but they don't need to be trees specifically you can create any object as static animated mesh and can distribute them on the terrain.

hope, I didn't make it sound like a complicated process.


Guest
Guest
Quote
2023-03-16 05:06:08

Talking about the "static collision box" setting inside the animated mesh editor menu. I managed to get collision on a static animated cube that I distributed on the terrain by setting the following values: 5,-5,5,-5,5,-5. Note sure if this is correct but it's the best result so far. Wish the documentation went into a little more detail.


just_in_case
Moderator
Quote
2023-03-16 07:24:26

Yeah, it takes the 3 axis (x,y,z) into account and it requires you to put a value in this format (minX,minY,minZ,maxX,maxY,maxZ) it takes the origin(pivot) of the object into account, so like with the default cubemesh. we know that it has a size of "10" and the pivot is in center of the cube.

so in order to create a perfect collision for the default cube we can set the collision box to (-5,-5,-5,5,5,5) because it will calculate from the origin of the object. Let's say for "Y" axis or the height of collision box, it calculates -5 from the origin of the object and creates an edge there, and then it checks +5 from the origin and creates an edge there, making the box with a height of 10 same as our default cube, same goes with the other axis as well.

So, it depends on the position of the pivot(origin) of your object and the size of your object for the static collision box. This is how you can calculate and generate static collision boxes.

I highly recommend using them when creating 2D games even in 3D games wherever necessary, as they show up in the editor and will keep your scenegraph explorer, neat and clean, and you don't have to add in extra geometry in your game by using dummy collision cubes, that people generally use in their games. It will increase the performance of the game as well. That is why CC's inbuilt terrain is so well optimized, it uses so many trees but there is no lag or performance drop because they all use static collision boxes.


Des
Guest
Quote
2023-03-16 15:38:19

Thanks guys


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact