H3D.org Forum Index Programming Issues
Is this a bug in CoordinateDeformer with multiple haptic devices? | Register To Post |
| Flat | Previous Topic | Next Topic |
| Poster | Thread |
|---|---|
| cgunn | Posted on: 2012/1/4 10:00 |
Just can't stay away ![]() ![]() Joined: 2004/12/7 From: Canberra, Australia Posts: 99 Online |
Is this a bug in CoordinateDeformer with multiple haptic devices? CoordinateDeformer::deformPoints has the following code (sorry about the formatting - this editor removes indents):
if( is_touched[0] ) { H3DFloat distance = (resting_points[i] - touch_points[0]).length(); offset = ( penetration_points[0] - touch_points[0] ) * f->get( distance ); } H3DFloat max_depth_sqr = offset * offset; for( unsigned int j = 1; j < nr_devices; j++ ) { if( is_touched[j] ) { H3DFloat d = (resting_points[i] - touch_points[j] ).length(); Vec3f o = ( penetration_points[j] - touch_points[j] ) * f->get( d ); if( o*o > max_depth_sqr ) { offset = o; } } } Note that max_depth_sqr is not reset when a new offset is assigned (near the end). This seems to result in the only last offset value being used, not the one that is the largest. Especially when device[0] is not touching, but device[1] is touching. Then max_depth_sqr stays as 0.0 the whole time. So the very last touching device's offset is used, not the greatest. This results in unexpected behavior with multiple devices. Seems like a bug, but I'm not sure. |
| Flat | Previous Topic | Next Topic |
| Subject | Poster | Date |
|---|---|---|
| » |
cgunn | 2012/1/4 10:00 |
| |
karlu | 2012/1/4 20:38 |
| |
Markus | 2012/1/4 23:26 |
| |
karlu | 2012/1/5 1:31 |
| |
cgunn | 2012/1/5 8:02 |
| |
karlu | 2012/1/5 15:07 |
| |
cgunn | 2012/1/6 7:59 |
| |
Markus | 2012/1/9 15:16 |
| |
cgunn | 2012/1/10 14:49 |
| Register To Post | |


