I have an idea. I'll put into pseudo code, then I'll try to figure it out in code.
for all connecting vertices,
find the closest point along that line to the hit point.
If the distance between that point and the hit point is < 96 / 2 then don't spawn object.
Edit: We would also need to ignore the line that goes diagonally.
This code will do a basic job of doing what you want, but it has limitations.
local hitPos = pickInfo.position
local surface = pickInfo.surface
local canPlace = true
for v = 0, surface:CountVertices() - 1 do
local vertPos = surface:GetVertexPosition(v)
if hitPos:DistanceToPoint(vertPos) < (0.96 / 2) then
canPlace = false
end
end
print(canPlace)
Try creating a new project and follow these steps:
1. Create empty project.
2. Create a floor.
3. Create a box on the foor.
4. Apply the default grass material to both.
5. Set the grass material's diffuse alpha to 0 (the 4th value)
6. Download the SSLR shader.
7. Add the shader to the scene root.
If that doesn't work, then something is wrong, because I did just that and it works fine.
And make sure to pan the camera in different angles, as it's only visible in certain angles.
What are the assumptions being made? Are all the surfaces square? Are the surfaces CSG? or does it need to check for any possible surface?
Edit: And what about the model being placed? Is that just a flat plane, or can this be a complex object?
Oh, okay. I didn't fully understand what you are doing. So by my understanding, AABB is only calculated if an object is in the world. That's why you're getting 0,0,0; 0,0,0
I've attached some images that will help to setup the shader. Keep in mind that some materials, such as ones with lots of bumpiness will show less reflection, as they are not flat.
Let me know if anything is unclear.
Edit: And I didn't even need photoshop or GIMP, or any other software to use it.
You can't expect everything to work out of the box. Some assets require some work to setup for your specific need. And it is a free asset, so don't expect the creator to keep it up to date and provide a detailed documentation. I'm just grateful that they put this out for people to use freely. If this was a paid asset on the other hand, I would expect them to help out.
I'm going to install this shader and try to help you out. I'll do my best to understand it and help you use it.
Is this what you're looking for?
http://www.leadwerks.com/werkspace/page/api-reference/_/surface/surfacegetaabb-r235
Or do you want something that finds the area of just certain faces of the mesh
If you click the root in your scene panel, you will see some settings. Post processing effects is one of them. This is where you add your effects. As far as I know, you need to add the .lua version of the shader, not the .shader file.
It sounds like there is also a custom shader for the material, but I don't know for sure until I try to use it myself.
Leadwerks doesn't use a set FPS value. There is a playback speed when you play the animation, so you can use any.
As for the weapon going through walls, I believe you can fix this by using 2 worlds. One world will have your gun, and the other world will have everything else. I did this in a previous project, but can't remember exactly how I did it. I just know it can be done like this.
Usage:
1. Use as very first postprocess shader
2. Use entity alpha or material alpha to control reflection power.
Did you do this?
And do you have AMD or NVIDIA?
I don't want to replace GetSpeed(), and I don't want to start an argument over what "makes more sense". I'd like to see both available, and for people to choose what they'd rather use.
You would setup your GUI to allow the user to change the values, whether it is using simple textboxes or fancy sliders.
You would then save a config file using File System.
From what I can tell, no you don't need to be a company. There is a tick box that asks if you are a company, but I don't think you need to tick it to submit the item. Just leave it unticked.
Can the Time class get a delta time added to it please?
GetSpeed is really confusing, and isn't very useful.
Also, people transitioning from Unity would understand this a lot better.
It wouldn't be very difficult, you could just write a small function that returned:
1.0 / Time:UPS()
Then you could just go:
timer = timer + Time.deltaTime
and the time will count up in seconds, regardless of the frame rate