Jump to content

CSG merge/don't merge option


AggrorJorn
 Share

Recommended Posts

I am posting as a result from this topic:

http://www.leadwerks...o-c/#entry56549

 

When I load a map, I check if the object in a scene exists (in C++). CSG brushes are not loaded by default. Only with A script attached to it when the brush has a non zero mass.

 

Now I have this trigger that doesn't need a script and also doesn't have a mass. In order for me to load it I have to attach an empty script to it in order for it to be loaded in.

 

Can we have a merge (by default set to true) option that allows us to get brushes as entities when loading a map?

This option is actually present but doesn't seem to affect loading behaviour.

  • Upvote 3
Link to comment
Share on other sites

Just an idea until Josh decides:

set the mass in the editor to anything else then 0 and reset it in your code.

Trigger::Trigger(Entity* entity)
{
    this->entity = entity;
    //...
    this->entity->SetMass(0);
}

Link to comment
Share on other sites

I think what he means is to set the mass to say 5 in the editor, then when you process your entity set the mass to 0 so it doesn't have mass. The setting of the mass to a non zero value will make sure it can be processed via Map::Load() and setting it back to 0 after you processed it makes sure it doesn't fall to the ground.

 

This should work and is another alternative until Josh gives us a merge flag for CSG :)

Link to comment
Share on other sites

Coming back to this the mass thing will work but you might actually want mass on some csg objects and so automatically just setting the mass to 0 might not work as you'd have to be very specific then for each object to check if it's the one you ant mass on and then not set it. Where the script method you don't have to worry about that, or better yet the "merging" flag we are hoping for solves all.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...