Search found 3947 matches

by vitek
Mon Apr 26, 2010 3:34 pm
Forum: Beginners Help
Topic: Itimer confusion!
Replies: 3
Views: 429

The ITimer interface doesn't provide the time of day. If you want that, use the C functions time() and localtime() or strftime() . If you want to know how long the program has been running, you could use ITimer . You need to get a snapshot of the initial value of the timer, and the current value. Th...
by vitek
Thu Apr 22, 2010 3:34 pm
Forum: Beginners Help
Topic: (Un)packing values via bit shifting
Replies: 3
Views: 397

Why not just do something like this... struct packed_info { uint16_t facing : 1 uint16_t y_coord : 4; uint16_t x_coord : 4; }; And let the compiler worry about the bit packing for you? If you really want to do the masking and shifting yourself, the model is simple. Figure out what the bitmask and sh...
by vitek
Tue Apr 20, 2010 6:15 pm
Forum: Beginners Help
Topic: Position relative to camera position [SOLVED]
Replies: 8
Views: 724

The problem lies here... rot = Camera->getRotation(); shift = rot.normalize(); The camera rotation is not a vector in the normal sense. It is a series of three values, the rotations around the X, Y and Z axes. Are the projectile-beam turrets supposed to be attached to the camera 'pod', or is the cam...
by vitek
Mon Apr 19, 2010 4:07 am
Forum: Beginners Help
Topic: [solved] A quad not rendered correctly
Replies: 9
Views: 844

You aren't setting the view/projection matrices. This was mentioned by one of the first responders.

Travis
by vitek
Sat Apr 17, 2010 9:44 pm
Forum: Beginners Help
Topic: [solved] A quad not rendered correctly
Replies: 9
Views: 844

If you don't post working code, you're not likely to get help.

Travis
by vitek
Sat Apr 17, 2010 9:42 pm
Forum: Beginners Help
Topic: Generating terrain from a plain c++ array
Replies: 41
Views: 3157

terrain = smgr->addTerrainSceneNode(device->getFileSystem()->createMemoryReadFile ((void*)lpBits, size, "heightmap",true), NULL, // parent node -1, // node id core::vector3df(0, 0, 0), // position core::vector3df(0, rotZ, 0), // rotation core::vector3df(rescaleX,rescaleZ,rescaleY), // sca...
by vitek
Fri Apr 16, 2010 6:22 pm
Forum: Bug reports
Topic: Boundingbox of ILightSceneNode worries
Replies: 4
Views: 641

Does the bounding box look correct? i.e., if you have a light with radius R, and a surface (with lighting enabled and a valid normal), does the light show up on the surface only when the surface intersects the bounding box?
by vitek
Fri Apr 16, 2010 6:16 pm
Forum: Beginners Help
Topic: get rotation of a triangle
Replies: 1
Views: 234

Get the orthornormal basis for your triangle (the up, left and forward vectors) in the coordinate system of the cube's parent, and then rotate the cube into alignment. You could probably do this by using getting the world rotations of the triangle and cube as quaternions, and then finding the differ...
by vitek
Fri Apr 16, 2010 4:43 am
Forum: Advanced Help
Topic: ROUNDING_ERROR_f32 too big? (f64 too?)
Replies: 9
Views: 2192

If there is a function macro named min() you can prevent the preprocessor from expanding it by using an additional set of parens.

Code: Select all

f32 d = ...;
if( d < std::numeric_limits<T>::(min)())
Travis
by vitek
Fri Apr 16, 2010 4:31 am
Forum: Bug reports
Topic: Boundingbox of ILightSceneNode worries
Replies: 4
Views: 641

I've noticed this before, but been to lazy to mention it. To get a minimum bounding box for a sphere with a radius r , it should be BBox.MaxEdge.set( r, r, r ); BBox.MinEdge.set( -r, -r, -r ); So at least part of the code is right... The whole (r*r)/2.f thing is garbage. It should be LightData.Radiu...
by vitek
Fri Apr 16, 2010 4:15 am
Forum: Beginners Help
Topic: drawVertexPrimitiveList
Replies: 1
Views: 1294

It looks like you are not using drawVertexPrimitiveList() correctly. The first and third parameters are pointers to vertex data and index data respectively. You are passing pointers to the vertex buffer and index buffer instead. Another thing that you can do to improve the safety of your code is to ...
by vitek
Sun Apr 04, 2010 6:09 pm
Forum: Beginners Help
Topic: Newbie std::string problem, printing wrong info:S
Replies: 9
Views: 1527

The error with your original code has to do with how you call itoa() . You pass the same buffer parameter to both calls. The sequence of statements you wrote... std::string u = itoa(numUnits, num, 10) + std::string(" | ") + itoa(unitLimit, num, 10); I can't remember the rules of sequence p...
by vitek
Wed Mar 31, 2010 9:00 pm
Forum: Open Discussion and Dev Announcements
Topic: Virtual functions and creator functions in scene manager
Replies: 6
Views: 1602

Most everything in Irrlicht is hidden behind an interface. This allows the implementation to vary without affecting the interface (i.e., a reference or pointer to ITexture can refer to a COpenGLTexture ). This is necessary in some places to support different rendering libraries (opengl, d3d, softwar...
by vitek
Mon Mar 29, 2010 4:53 pm
Forum: Beginners Help
Topic: Tricky problem with textures... any ideas welcome!
Replies: 10
Views: 1323

You could use the texture matrix to deal with this also.
by vitek
Mon Mar 29, 2010 4:51 pm
Forum: Beginners Help
Topic: rotate a particle emitter
Replies: 5
Views: 587

It seems you could implement a scene node similar to a dummy scene node that would ignore the rotation of its parent. You could do this by inheriting from ISceneNode and overriding updateAbsolutePosition() to ignore the rotation of the parent scene node (if any). Then you just need to attach one of ...