Iterating vertices and edges, accessing, modifying and storing their data

Hello! I’d like to find out if it is possible to iterate through vertices and edges in Python. Also it’d be great to find out if I can assign properties to individual vertices and edges. Also, how do I move each single vertex and recalculate it’s normals without much performance cost?

There is a example right at the top.

I think there is a inherit performance drop in big meshes, as after the change, all of the mesh needs to be re-sent to gpu memory or something.

just verticas and faces. Check the BGE API. Lookfor KX_MeshProxy.

No, you cant.

A) there are no edges
B) there is no reason to do so. Vertices describe coordinates of a mesh. It is not a storage for other data. If you want to establish a relationship with other data, I suggest to apply it to the other data or create a mapping from the other data to the vertices.

Surely not. Each single operation will be processed and therefore costs time even when it does not change anything.

The question you need to ask yourself is, how much change do you need and how often. This allows you to estimate if you get acceptable processing time.

Well, you can assign vertex colors and uv coordinates, which can be used to store data in a hack way.
But you are better off storing data somewhere else anyway.

It’s for softbody tire & damage simulation(like RoR). I don’t know if or sensor-static collisions are possible to access in python. Also I doubt about sensor-sensor collisions.

Did you perhaps mean to have each vertex with a game property?
I mean you could just (vertex) parent empties to vertex positions…

Anyway, sensors are meant for character logic.
Think for yourself if each vertex were a npc, would your game perform reasonably?

You are better off with some custom algorithm. Tree data structure and some plane intersection abstraction, maybe.

Hm… It seams that I’d be required to modify the source code for this and create a new physics type rather than coding it in-GE. I’ve got no skills for this, tho.

Nope, just parent sensor objects to the wheel, the more they hit the ground, while accelerating and while braking the more they should mess up the tire, same for when slipping,

so moving sideways while touching = damage

burning out = damage

each sensor that is damaged, could reduce your total tire friction for that tire

I don’t need damage as much as soft-body system(including tire springiness, shifting during sideskids, folding, automatic relaxation length etc.). However, I think that I can approximate this with rays. Using some primitive brush model concepts and casting several rays from tire should result in high-quality and high-performance results;)