Anonymous Login
2019-04-22 14:25 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001351OpenClonkEnginepublic2019-03-30 19:38
ReporterMarky 
Assigned To 
PrioritylowSeverityfeatureReproducibilityhave not tried
StatusnewResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0001351: Object physics - Connected vertices
DescriptionA solid line between vertices could improve the way trees and other objects interact with the landscape.

The scripter should be able to specify that a pair of vertices is connected to each other, with a line.

Optional: This could be tied in with the other two physics issues (how do I add a link?):
- the spring constant would be a property of the connection
- ragdoll connections between vertices non-mesh objects could be specified this way
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0003705

Maikel (developer)

This actually sounds interesting, and independent on meshes and vertices of models. I'd love to see an attempt for this. It can also prevent lorries and clonks stucking on thin solid masks like the elevator case.

~0003706

Sven2 (developer)

I would dramatically increase the number of required collision checks for large objects of course.

~0003708

Marky (developer)

I did not think about the details yet. Where would I find collision checks in the source code?

~0003714

Sven2 (developer)

It should all lead to C4Shape::ContactCheck or something like that.

~0006211

Marky (developer)

So, currently I am looking at the shape code, and I feel confident enough to add the line check. However, I am struggling with the format for specifying a vertex line for the object:
- should it be a DefCore entry?
- should it be a property?
- how to write it?

For example, I'd want to have the foot vertices of the Clonk to connect as lines, which would possibly solve the "stuck on landscape edge" problem. So the Clonk vertices are a good example for the format:

Example 1:
Specify the vertex (index + 1) to which that vertex is connected. In this example vertex 7 and 8 are connected to vertex 2. I chose this instead of -1, -1, ..., 2, 2 because it seemed more logical to use "0" as non-assigned default value; if we would simply initialize the property with -1 if there is no value I'd be happy, too.
VertexX= 0, 0, 0, -2, 2, -4, 4, -2, 2
VertexY= 2, -7, 9, -3, -3, 2, 2, 6, 6
VertexCNAT= 128,132, 11,129,130,129,130,129,130
VertexLine= 0, 0, 0, 0, 0, 0, 0, 3, 3

Example 2:
Specify the lines as arrays. Not sure if DefCore can parse this, and whether it is easy to understand.
VertexX= 0, 0, 0, -2, 2, -4, 4, -2, 2
VertexY= 2, -7, 9, -3, -3, 2, 2, 6, 6
VertexCNAT= 128,132, 11,129,130,129,130,129,130
VertexLine = [2, 7], [2, 8]

Regarding the implementation, do we have any requirements? The contact check assigns information to each vertex: does it have contact left/right/top/bottom?
For a vertex line, I'd assign the contact information to both ends of the line if a "virtual" vertex in between has contact with the landscape.
This could possibly break the GetContact function, however? It only checks if that specific vertex has landscape pixels left/right/top/bottom, for a specific density provider. If it were to use the saved contact information from the ContactCheck, then everything is fine, but if not then you can have actual contact with the landscape, but the vertex itself has no contact (e.g. a tree with then 2 vertices touching a small island at the middle of the line).
+Notes

-Issue History
Date Modified Username Field Change
2015-07-05 18:23 Marky New Issue
2015-07-14 13:41 Maikel Note Added: 0003705
2015-07-14 16:07 Sven2 Note Added: 0003706
2015-07-14 18:08 Marky Note Added: 0003708
2015-07-16 05:15 Sven2 Note Added: 0003714
2019-03-30 19:38 Marky Note Added: 0006211
+Issue History