instance at specified point with specified orientation
| 563 | |
| 564 | // instance at specified point with specified orientation |
| 565 | void StartLightingInstance(vector *pos, matrix *orient) { |
| 566 | vector tempv; |
| 567 | |
| 568 | ASSERT(Light_instance_depth < MAX_SUBOBJECTS); |
| 569 | |
| 570 | Light_instance_stack[Light_instance_depth].p = Light_position; |
| 571 | if (Use_light_direction) |
| 572 | Light_instance_stack[Light_instance_depth].dir = Light_direction; |
| 573 | Light_instance_depth++; |
| 574 | |
| 575 | // Step 1: subtract position from light position |
| 576 | tempv = Light_position - *pos; |
| 577 | // step 2: rotate view vector through object matrix |
| 578 | |
| 579 | Light_position = tempv * *orient; |
| 580 | |
| 581 | // Rotate the light direction through this matrix |
| 582 | if (Use_light_direction) { |
| 583 | tempv = Light_direction; |
| 584 | Light_direction = tempv * *orient; |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | // pops the old context |
| 589 | void DoneLightingInstance() { |
no outgoing calls
no test coverage detected