Tag Info

New answers tagged

0

For the sad weary soul a decade from now who stumbles upon this question wishing for it to be answered: void main(void){ vec3 p1 = mix(tcPosition[0], tcPosition[3], gl_TessCoord.x);//may have to rearrange these numbers depending on your implementation vec3 p2 = mix(tcPosition[1], tcPosition[2], gl_TessCoord.x); vec3 pos = normalize(mix(p1, p2, ...


14

The dot product of two vectors can tell you if they face each other or not. First vector can probably be the enemies view direction the second one should be a vector pointing from player's position to the enemies position. https://www.youtube.com/watch?v=Q9FZllr6-wY


0

You can use this library github.com/pents90/svg-android only for android. Andengine (IDK if still in development) has an extension using this library https://github.com/nicolasgramlich/AndEngineSVGTextureRegionExtension LibGDX is not integrating this kind of feature because cannot support all platforms, just android, you can integrate this manually if your ...


0

Personally, I needed something with a little longer range than the default when I needed this. If that's the case for you too, I pretty much copied getMouseOver(), changing a few variables and names to get what I needed. Here's the original: public void getMouseOver(float par1) { if (this.mc.renderViewEntity != null) { if (this.mc.theWorld ...


3

Assuming that location is the uniform location you've already retrieved from the shader, and vec is your vector, then in C++11 you can do: glUniform3fv(location, vec.size(), reinterpret_cast<GLfloat *>(vec.data())); Prior to C++11: glUniform3fv(location, vec.size(), reinterpret_cast<GLfloat *>(&vec[0])); The "old" method will work in ...


0

Assuming your Vector3f class is laid out linear in memory. std::vector<Vector3f> m_verts; float* address = &m_verts[0].x; This will get the address of the x value of the first element, so long as your data is laid out linearly, and your sizeof(Vector3f) == size(float) * 3 you should be fine.


3

I would consider generating waypoint graphs instead. They're easy to work with, they give optimal paths, and are generally fast enough for reasonably small environments. The optimal path will be a series of line segments, and each vertex in the path will either be the origin, the destination, or a vertex of one of your obstacles. So although your ...



Top 50 recent answers are included