1 /*! @header QuesaLight.h 2 Declares the Quesa light objects. 3 */ 4 /* NAME: 5 QuesaLight.h 6 7 DESCRIPTION: 8 Quesa public header. 9 10 COPYRIGHT: 11 Copyright (c) 1999-2004, Quesa Developers. All rights reserved. 12 13 For the current release of Quesa, please see: 14 15 <http://www.quesa.org/> 16 17 Redistribution and use in source and binary forms, with or without 18 modification, are permitted provided that the following conditions 19 are met: 20 21 o Redistributions of source code must retain the above copyright 22 notice, this list of conditions and the following disclaimer. 23 24 o Redistributions in binary form must reproduce the above 25 copyright notice, this list of conditions and the following 26 disclaimer in the documentation and/or other materials provided 27 with the distribution. 28 29 o Neither the name of Quesa nor the names of its contributors 30 may be used to endorse or promote products derived from this 31 software without specific prior written permission. 32 33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 34 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 35 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 36 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 37 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 38 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 39 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 40 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 41 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 42 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 ___________________________________________________________________________ 45 */ 46 #ifndef QUESA_LIGHT_HDR 47 #define QUESA_LIGHT_HDR 48 //============================================================================= 49 // Include files 50 //----------------------------------------------------------------------------- 51 #include "Quesa.h" 52 53 // Disable QD3D header 54 #if defined(__QD3DLIGHT__) 55 #error 56 #endif 57 58 #define __QD3DLIGHT__ 59 60 61 62 63 64 //============================================================================= 65 // C++ preamble 66 //----------------------------------------------------------------------------- 67 #ifdef __cplusplus 68 extern "C" { 69 #endif 70 71 72 73 74 75 //============================================================================= 76 // Constants 77 //----------------------------------------------------------------------------- 78 /*! 79 * @enum 80 * TQ3AttenuationType 81 * @discussion 82 * Light attenuation methods. 83 * 84 * The attenuation of a light controls how the intensity of the light 85 * is diminished over distance. In the real world, the itensity of a 86 * light source is attenuated as 1/(d*d). 87 * 88 * @constant kQ3AttenuationTypeNone Intensity is not attenuated. 89 * @constant kQ3AttenuationTypeInverseDistance Intensity is attenuated as 1/d. 90 * @constant kQ3AttenuationTypeInverseDistanceSquared Intensity is attenuated as 1/(d*d). 91 */ 92 typedef enum { 93 kQ3AttenuationTypeNone = 0, 94 kQ3AttenuationTypeInverseDistance = 1, 95 kQ3AttenuationTypeInverseDistanceSquared = 2, 96 kQ3AttenuationTypeSize32 = 0xFFFFFFFF 97 } TQ3AttenuationType; 98 99 100 /*! 101 * @enum 102 * TQ3FallOffType 103 * @discussion 104 * Light fall-off methods. 105 * 106 * The fall-off value of a light controls how the intensity of the light 107 * varies from the edge of the hot angle (where the light is at full intensity) 108 * to the outer angle (where the light intensity falls to zero). 109 * 110 * @constant kQ3FallOffTypeNone Intensity does not fall off. 111 * @constant kQ3FallOffTypeLinear Intensity falls off linearly. 112 * @constant kQ3FallOffTypeExponential Intensity falls off exponentially. 113 * @constant kQ3FallOffTypeCosine Intensity falls off as the cosine of the angle. 114 */ 115 typedef enum { 116 kQ3FallOffTypeNone = 0, 117 kQ3FallOffTypeLinear = 1, 118 kQ3FallOffTypeExponential = 2, 119 kQ3FallOffTypeCosine = 3, 120 kQ3FallOffSize32 = 0xFFFFFFFF 121 } TQ3FallOffType; 122 123 124 125 126 127 //============================================================================= 128 // Types 129 //----------------------------------------------------------------------------- 130 /*! 131 * @struct 132 * TQ3LightData 133 * @discussion 134 * Describes the common state for a light. 135 * 136 * The common light state includes the on/off state, brightness, and color. 137 * Brightness and color values should be between 0.0 and 1.0 inclusive. 138 * 139 * Some renderers may support over-saturated lights (where the brightness 140 * value is greater than 1.0), or even negative brightness (where the value 141 * is less than 0.0). 142 * 143 * The effect of such brightness values is renderer-specific, and may result 144 * in kQ3NoticeBrightnessGreaterThanOne or kQ3NoticeBrightnessLessThanZero 145 * warnings. 146 * 147 * @field isOn Controls if the light is active or not. 148 * @field brightness The brightness of the light. 149 * @field color The colour of the light. 150 */ 151 typedef struct TQ3LightData { 152 TQ3Boolean isOn; 153 float brightness; 154 TQ3ColorRGB color; 155 } TQ3LightData; 156 157 158 /*! 159 * @struct 160 * TQ3DirectionalLightData 161 * @discussion 162 * Describes the state for a directional light. 163 * 164 * A directional light is defined by a vector, which indicates the 165 * world-space direction away from the light source. 166 * 167 * @field lightData The common state for the light. 168 * @field castsShadows Indicates if the light casts shadows. 169 * @field direction The direction of the light. 170 */ 171 typedef struct TQ3DirectionalLightData { 172 TQ3LightData lightData; 173 TQ3Boolean castsShadows; 174 TQ3Vector3D direction; 175 } TQ3DirectionalLightData; 176 177 178 /*! 179 * @struct 180 * TQ3PointLightData 181 * @discussion 182 * Describes the state for a point light. 183 * 184 * A point light is defined by a coordinate in world space, and an 185 * attenuation value which controls how the light diminishes with 186 * distance. 187 * 188 * @field lightData The common state for the light. 189 * @field castsShadows Indicates if the light casts shadows. 190 * @field attenuation The attenuation style of the light. 191 * @field location The location of the light. 192 */ 193 typedef struct TQ3PointLightData { 194 TQ3LightData lightData; 195 TQ3Boolean castsShadows; 196 TQ3AttenuationType attenuation; 197 TQ3Point3D location; 198 } TQ3PointLightData; 199 200 201 /*! 202 * @struct 203 * TQ3SpotLightData 204 * @discussion 205 * Describes the state for a spot light. 206 * 207 * A spot light is defined by a coordinate in world space, a vector 208 * away from that coordinate, and an attenuation value which controls 209 * how the light diminishes with distance. 210 * 211 * A spot light casts a cone of light, where the cone is defined by 212 * two angles. The hot angle is the angle from the center of the light 213 * cone to the point where the light intensity starts to drop, and the 214 * outerAngle is the angle from the center of the light to the point 215 * where the light intensity has fallen to zero. 216 * 217 * The way the light intensity diminishes between the hotAngle and 218 * outerAngle values is controlled by the light fallOff value. 219 * 220 * Both hotAngle and outerAngle are half-angles from the center of the 221 * light cone, and are specified in radians. They both range from 0.0 222 * to kQ3Pi/2.0 (inclusive), and the outerAngle must be equal than or 223 * greater to the hotAngle. 224 * 225 * @field lightData The common state for the light. 226 * @field castsShadows Indicates if the light casts shadows. 227 * @field attenuation The attenuation style of the light. 228 * @field location The location of the light. 229 * @field direction The direction of the light. 230 * @field hotAngle The half-angle where the light intensity starts to drop. 231 * @field outerAngle The half-angle where the light intensity reaches zero. 232 * @field fallOff The fall off between the hotAngle and the outerAngle. 233 */ 234 typedef struct TQ3SpotLightData { 235 TQ3LightData lightData; 236 TQ3Boolean castsShadows; 237 TQ3AttenuationType attenuation; 238 TQ3Point3D location; 239 TQ3Vector3D direction; 240 float hotAngle; 241 float outerAngle; 242 TQ3FallOffType fallOff; 243 } TQ3SpotLightData; 244 245 246 247 248 249 //============================================================================= 250 // Function prototypes 251 //----------------------------------------------------------------------------- 252 /*! 253 * @function 254 * Q3Light_GetType 255 * @discussion 256 * Get the type of a light. 257 * 258 * Returns kQ3ObjectTypeInvalid if the light type is unknown. 259 * 260 * @param light The light to query. 261 * @result The type of the light object. 262 */ 263 Q3_EXTERN_API_C ( TQ3ObjectType ) 264 Q3Light_GetType ( 265 TQ3LightObject light 266 ); 267 268 269 270 /*! 271 * @function 272 * Q3Light_GetState 273 * @discussion 274 * Get the on/off state of a light. 275 * 276 * @param light The light to query. 277 * @param isOn Receives true/false as the light is on. 278 * @result Success or failure of the operation. 279 */ 280 Q3_EXTERN_API_C ( TQ3Status ) 281 Q3Light_GetState ( 282 TQ3LightObject light, 283 TQ3Boolean *isOn 284 ); 285 286 287 288 /*! 289 * @function 290 * Q3Light_GetBrightness 291 * @discussion 292 * Get the brightness of a light. 293 * 294 * @param light The light to query. 295 * @param brightness Receives the brightness of the light. 296 * @result Success or failure of the operation. 297 */ 298 Q3_EXTERN_API_C ( TQ3Status ) 299 Q3Light_GetBrightness ( 300 TQ3LightObject light, 301 float *brightness 302 ); 303 304 305 306 /*! 307 * @function 308 * Q3Light_GetColor 309 * @discussion 310 * Get the color of a light. 311 * 312 * @param light The light to query. 313 * @param color Receives the color of the light. 314 * @result Success or failure of the operation. 315 */ 316 Q3_EXTERN_API_C ( TQ3Status ) 317 Q3Light_GetColor ( 318 TQ3LightObject light, 319 TQ3ColorRGB *color 320 ); 321 322 323 324 /*! 325 * @function 326 * Q3Light_SetState 327 * @discussion 328 * Set the on/off state for a light. 329 * 330 * @param light The light to update. 331 * @param isOn True or false as the light is on. 332 * @result Success or failure of the operation. 333 */ 334 Q3_EXTERN_API_C ( TQ3Status ) 335 Q3Light_SetState ( 336 TQ3LightObject light, 337 TQ3Boolean isOn 338 ); 339 340 341 342 /*! 343 * @function 344 * Q3Light_SetBrightness 345 * @discussion 346 * Set the brightness of a light. 347 * 348 * @param light The light to update. 349 * @param brightness The new brightness for the light. 350 * @result Success or failure of the operation. 351 */ 352 Q3_EXTERN_API_C ( TQ3Status ) 353 Q3Light_SetBrightness ( 354 TQ3LightObject light, 355 float brightness 356 ); 357 358 359 360 /*! 361 * @function 362 * Q3Light_SetColor 363 * @discussion 364 * Set the color of a light. 365 * 366 * @param light The light to update. 367 * @param color The new color for the light. 368 * @result Success or failure of the operation. 369 */ 370 Q3_EXTERN_API_C ( TQ3Status ) 371 Q3Light_SetColor ( 372 TQ3LightObject light, 373 const TQ3ColorRGB *color 374 ); 375 376 377 378 /*! 379 * @function 380 * Q3Light_GetData 381 * @discussion 382 * Get the common state of a light. 383 * 384 * @param light The light to query. 385 * @param lightData Receives the common state of the light. 386 * @result Success or failure of the operation. 387 */ 388 Q3_EXTERN_API_C ( TQ3Status ) 389 Q3Light_GetData ( 390 TQ3LightObject light, 391 TQ3LightData *lightData 392 ); 393 394 395 396 /*! 397 * @function 398 * Q3Light_SetData 399 * @discussion 400 * Set the common state for a light. 401 * 402 * @param light The light to update. 403 * @param lightData The new common state for the light. 404 * @result Success or failure of the operation. 405 */ 406 Q3_EXTERN_API_C ( TQ3Status ) 407 Q3Light_SetData ( 408 TQ3LightObject light, 409 const TQ3LightData *lightData 410 ); 411 412 413 414 /*! 415 * @function 416 * Q3AmbientLight_New 417 * @discussion 418 * Create a new ambient light object. 419 * 420 * @param lightData The data for the light object. 421 * @result The new light object. 422 */ 423 Q3_EXTERN_API_C ( TQ3LightObject ) 424 Q3AmbientLight_New ( 425 const TQ3LightData *lightData 426 ); 427 428 429 430 /*! 431 * @function 432 * Q3AmbientLight_GetData 433 * @discussion 434 * Get the data for an ambient light. 435 * 436 * @param light The light to query. 437 * @param lightData Receives the data of the light. 438 * @result Success or failure of the operation. 439 */ 440 Q3_EXTERN_API_C ( TQ3Status ) 441 Q3AmbientLight_GetData ( 442 TQ3LightObject light, 443 TQ3LightData *lightData 444 ); 445 446 447 448 /*! 449 * @function 450 * Q3AmbientLight_SetData 451 * @discussion 452 * Set the data for an ambient light. 453 * 454 * @param light The light to update. 455 * @param lightData The new data for the light. 456 * @result Success or failure of the operation. 457 */ 458 Q3_EXTERN_API_C ( TQ3Status ) 459 Q3AmbientLight_SetData ( 460 TQ3LightObject light, 461 const TQ3LightData *lightData 462 ); 463 464 465 466 /*! 467 * @function 468 * Q3DirectionalLight_New 469 * @discussion 470 * Create a new directional light object. 471 * 472 * @param directionalLightData The data for the light object. 473 * @result The new light object. 474 */ 475 Q3_EXTERN_API_C ( TQ3LightObject ) 476 Q3DirectionalLight_New ( 477 const TQ3DirectionalLightData *directionalLightData 478 ); 479 480 481 482 /*! 483 * @function 484 * Q3DirectionalLight_GetCastShadowsState 485 * @discussion 486 * Get the cast-shadow state of a directional light. 487 * 488 * @param light The light to query. 489 * @param castsShadows Receives true or false as the light casts shadows. 490 * @result Success or failure of the operation. 491 */ 492 Q3_EXTERN_API_C ( TQ3Status ) 493 Q3DirectionalLight_GetCastShadowsState ( 494 TQ3LightObject light, 495 TQ3Boolean *castsShadows 496 ); 497 498 499 500 /*! 501 * @function 502 * Q3DirectionalLight_GetDirection 503 * @discussion 504 * Get the direction of a directional light. 505 * 506 * @param light The light to query. 507 * @param direction Receives the direction of the light. 508 * @result Success or failure of the operation. 509 */ 510 Q3_EXTERN_API_C ( TQ3Status ) 511 Q3DirectionalLight_GetDirection ( 512 TQ3LightObject light, 513 TQ3Vector3D *direction 514 ); 515 516 517 518 /*! 519 * @function 520 * Q3DirectionalLight_SetCastShadowsState 521 * @discussion 522 * Set the cast-shadow state of a directional light. 523 * 524 * @param light The light to update. 525 * @param castsShadows True or false as the light casts shadows. 526 * @result Success or failure of the operation. 527 */ 528 Q3_EXTERN_API_C ( TQ3Status ) 529 Q3DirectionalLight_SetCastShadowsState ( 530 TQ3LightObject light, 531 TQ3Boolean castsShadows 532 ); 533 534 535 536 /*! 537 * @function 538 * Q3DirectionalLight_SetDirection 539 * @discussion 540 * Set the direction of a directional light. 541 * 542 * @param light The light to update. 543 * @param direction The new direction for the light. 544 * @result Success or failure of the operation. 545 */ 546 Q3_EXTERN_API_C ( TQ3Status ) 547 Q3DirectionalLight_SetDirection ( 548 TQ3LightObject light, 549 const TQ3Vector3D *direction 550 ); 551 552 553 554 /*! 555 * @function 556 * Q3DirectionalLight_GetData 557 * @discussion 558 * Get the data for a directional light. 559 * 560 * @param light The light to query. 561 * @param directionalLightData Receives the data of the light. 562 * @result Success or failure of the operation. 563 */ 564 Q3_EXTERN_API_C ( TQ3Status ) 565 Q3DirectionalLight_GetData ( 566 TQ3LightObject light, 567 TQ3DirectionalLightData *directionalLightData 568 ); 569 570 571 572 /*! 573 * @function 574 * Q3DirectionalLight_SetData 575 * @discussion 576 * Set the data for a directional light. 577 * 578 * @param light The light to update. 579 * @param directionalLightData The new data for the light. 580 * @result Success or failure of the operation. 581 */ 582 Q3_EXTERN_API_C ( TQ3Status ) 583 Q3DirectionalLight_SetData ( 584 TQ3LightObject light, 585 const TQ3DirectionalLightData *directionalLightData 586 ); 587 588 589 590 /*! 591 * @function 592 * Q3PointLight_New 593 * @discussion 594 * Create a new point light object. 595 * 596 * @param pointLightData The data for the light object. 597 * @result The new light object. 598 */ 599 Q3_EXTERN_API_C ( TQ3LightObject ) 600 Q3PointLight_New ( 601 const TQ3PointLightData *pointLightData 602 ); 603 604 605 606 /*! 607 * @function 608 * Q3PointLight_GetCastShadowsState 609 * @discussion 610 * Get the cast-shadow state of a point light. 611 * 612 * @param light The light to query. 613 * @param castsShadows Receives true or false as the light casts shadows. 614 * @result Success or failure of the operation. 615 */ 616 Q3_EXTERN_API_C ( TQ3Status ) 617 Q3PointLight_GetCastShadowsState ( 618 TQ3LightObject light, 619 TQ3Boolean *castsShadows 620 ); 621 622 623 624 /*! 625 * @function 626 * Q3PointLight_GetAttenuation 627 * @discussion 628 * Get the attenuation of a point light. 629 * 630 * @param light The light to query. 631 * @param attenuation Receives the attenuation of the light. 632 * @result Success or failure of the operation. 633 */ 634 Q3_EXTERN_API_C ( TQ3Status ) 635 Q3PointLight_GetAttenuation ( 636 TQ3LightObject light, 637 TQ3AttenuationType *attenuation 638 ); 639 640 641 642 /*! 643 * @function 644 * Q3PointLight_GetLocation 645 * @discussion 646 * Get the location of a point light. 647 * 648 * @param light The light to query. 649 * @param location Receives the location of the light. 650 * @result Success or failure of the operation. 651 */ 652 Q3_EXTERN_API_C ( TQ3Status ) 653 Q3PointLight_GetLocation ( 654 TQ3LightObject light, 655 TQ3Point3D *location 656 ); 657 658 659 660 /*! 661 * @function 662 * Q3PointLight_GetData 663 * @discussion 664 * Get the data for a point light. 665 * 666 * @param light The light to query. 667 * @param pointLightData Receives the data of the light. 668 * @result Success or failure of the operation. 669 */ 670 Q3_EXTERN_API_C ( TQ3Status ) 671 Q3PointLight_GetData ( 672 TQ3LightObject light, 673 TQ3PointLightData *pointLightData 674 ); 675 676 677 678 /*! 679 * @function 680 * Q3PointLight_SetCastShadowsState 681 * @discussion 682 * Set the cast-shadow state of a point light. 683 * 684 * @param light The light to update. 685 * @param castsShadows True or false as the light casts shadows. 686 * @result Success or failure of the operation. 687 */ 688 Q3_EXTERN_API_C ( TQ3Status ) 689 Q3PointLight_SetCastShadowsState ( 690 TQ3LightObject light, 691 TQ3Boolean castsShadows 692 ); 693 694 695 696 /*! 697 * @function 698 * Q3PointLight_SetAttenuation 699 * @discussion 700 * Set the attenuation of a point light. 701 * 702 * @param light The light to update. 703 * @param attenuation The new attenuation for the light. 704 * @result Success or failure of the operation. 705 */ 706 Q3_EXTERN_API_C ( TQ3Status ) 707 Q3PointLight_SetAttenuation ( 708 TQ3LightObject light, 709 TQ3AttenuationType attenuation 710 ); 711 712 713 714 /*! 715 * @function 716 * Q3PointLight_SetLocation 717 * @discussion 718 * Set the location of a point light. 719 * 720 * @param light The light to update. 721 * @param location The new location for the light. 722 * @result Success or failure of the operation. 723 */ 724 Q3_EXTERN_API_C ( TQ3Status ) 725 Q3PointLight_SetLocation ( 726 TQ3LightObject light, 727 const TQ3Point3D *location 728 ); 729 730 731 732 /*! 733 * @function 734 * Q3PointLight_SetData 735 * @discussion 736 * Set the data for a point light. 737 * 738 * @param light The light to update. 739 * @param pointLightData The new data for the light. 740 * @result Success or failure of the operation. 741 */ 742 Q3_EXTERN_API_C ( TQ3Status ) 743 Q3PointLight_SetData ( 744 TQ3LightObject light, 745 const TQ3PointLightData *pointLightData 746 ); 747 748 749 750 /*! 751 * @function 752 * Q3SpotLight_New 753 * @discussion 754 * Create a new spot light object. 755 * 756 * @param spotLightData The data for the light object. 757 * @result The new light object. 758 */ 759 Q3_EXTERN_API_C ( TQ3LightObject ) 760 Q3SpotLight_New ( 761 const TQ3SpotLightData *spotLightData 762 ); 763 764 765 766 /*! 767 * @function 768 * Q3SpotLight_GetCastShadowsState 769 * @discussion 770 * Get the cast-shadow state of a spot light. 771 * 772 * @param light The light to query. 773 * @param castsShadows Receives true or false as the light casts shadows. 774 * @result Success or failure of the operation. 775 */ 776 Q3_EXTERN_API_C ( TQ3Status ) 777 Q3SpotLight_GetCastShadowsState ( 778 TQ3LightObject light, 779 TQ3Boolean *castsShadows 780 ); 781 782 783 784 /*! 785 * @function 786 * Q3SpotLight_GetAttenuation 787 * @discussion 788 * Get the attenuation of a spot light. 789 * 790 * @param light The light to query. 791 * @param attenuation Receives the attenuation of the light. 792 * @result Success or failure of the operation. 793 */ 794 Q3_EXTERN_API_C ( TQ3Status ) 795 Q3SpotLight_GetAttenuation ( 796 TQ3LightObject light, 797 TQ3AttenuationType *attenuation 798 ); 799 800 801 802 /*! 803 * @function 804 * Q3SpotLight_GetLocation 805 * @discussion 806 * Get the location of a spot light. 807 * 808 * @param light The light to query. 809 * @param location Receives the location of the light. 810 * @result Success or failure of the operation. 811 */ 812 Q3_EXTERN_API_C ( TQ3Status ) 813 Q3SpotLight_GetLocation ( 814 TQ3LightObject light, 815 TQ3Point3D *location 816 ); 817 818 819 820 /*! 821 * @function 822 * Q3SpotLight_GetDirection 823 * @discussion 824 * Get the direction of a spot light. 825 * 826 * @param light The light to query. 827 * @param direction Receives the direction of the light. 828 * @result Success or failure of the operation. 829 */ 830 Q3_EXTERN_API_C ( TQ3Status ) 831 Q3SpotLight_GetDirection ( 832 TQ3LightObject light, 833 TQ3Vector3D *direction 834 ); 835 836 837 838 /*! 839 * @function 840 * Q3SpotLight_GetHotAngle 841 * @discussion 842 * Get the hot angle of a spot light. 843 * 844 * @param light The light to query. 845 * @param hotAngle Receives the hot angle of the light. 846 * @result Success or failure of the operation. 847 */ 848 Q3_EXTERN_API_C ( TQ3Status ) 849 Q3SpotLight_GetHotAngle ( 850 TQ3LightObject light, 851 float *hotAngle 852 ); 853 854 855 856 /*! 857 * @function 858 * Q3SpotLight_GetOuterAngle 859 * @discussion 860 * Get the outer angle of a spot light. 861 * 862 * @param light The light to query. 863 * @param outerAngle Receives the outer angle of the light. 864 * @result Success or failure of the operation. 865 */ 866 Q3_EXTERN_API_C ( TQ3Status ) 867 Q3SpotLight_GetOuterAngle ( 868 TQ3LightObject light, 869 float *outerAngle 870 ); 871 872 873 874 /*! 875 * @function 876 * Q3SpotLight_GetFallOff 877 * @discussion 878 * Get the fall off of a spot light. 879 * 880 * @param light The light to query. 881 * @param fallOff Receives the fall off value of the light. 882 * @result Success or failure of the operation. 883 */ 884 Q3_EXTERN_API_C ( TQ3Status ) 885 Q3SpotLight_GetFallOff ( 886 TQ3LightObject light, 887 TQ3FallOffType *fallOff 888 ); 889 890 891 892 /*! 893 * @function 894 * Q3SpotLight_GetData 895 * @discussion 896 * Get the data for a spot light. 897 * 898 * @param light The light to query. 899 * @param spotLightData Receives the data of the light. 900 * @result Success or failure of the operation. 901 */ 902 Q3_EXTERN_API_C ( TQ3Status ) 903 Q3SpotLight_GetData ( 904 TQ3LightObject light, 905 TQ3SpotLightData *spotLightData 906 ); 907 908 909 910 /*! 911 * @function 912 * Q3SpotLight_SetCastShadowsState 913 * @discussion 914 * Set the cast-shadow state of a spot light. 915 * 916 * @param light The light to update. 917 * @param castsShadows True or false as the light casts shadows. 918 * @result Success or failure of the operation. 919 */ 920 Q3_EXTERN_API_C ( TQ3Status ) 921 Q3SpotLight_SetCastShadowsState ( 922 TQ3LightObject light, 923 TQ3Boolean castsShadows 924 ); 925 926 927 928 /*! 929 * @function 930 * Q3SpotLight_SetAttenuation 931 * @discussion 932 * Set the attenuation for a spot light. 933 * 934 * @param light The light to update. 935 * @param attenuation The new attenuation for the light. 936 * @result Success or failure of the operation. 937 */ 938 Q3_EXTERN_API_C ( TQ3Status ) 939 Q3SpotLight_SetAttenuation ( 940 TQ3LightObject light, 941 TQ3AttenuationType attenuation 942 ); 943 944 945 946 /*! 947 * @function 948 * Q3SpotLight_SetLocation 949 * @discussion 950 * Set the location for a spot light. 951 * 952 * @param light The light to update. 953 * @param location The new location for the light. 954 * @result Success or failure of the operation. 955 */ 956 Q3_EXTERN_API_C ( TQ3Status ) 957 Q3SpotLight_SetLocation ( 958 TQ3LightObject light, 959 const TQ3Point3D *location 960 ); 961 962 963 964 /*! 965 * @function 966 * Q3SpotLight_SetDirection 967 * @discussion 968 * Set the direction of a spot light. 969 * 970 * @param light The light to update. 971 * @param direction The new direction for the light. 972 * @result Success or failure of the operation. 973 */ 974 Q3_EXTERN_API_C ( TQ3Status ) 975 Q3SpotLight_SetDirection ( 976 TQ3LightObject light, 977 const TQ3Vector3D *direction 978 ); 979 980 981 982 /*! 983 * @function 984 * Q3SpotLight_SetHotAngle 985 * @discussion 986 * Set the hot angle of a spot light. 987 * 988 * @param light The light to update. 989 * @param hotAngle The new hot angle for the light. 990 * @result Success or failure of the operation. 991 */ 992 Q3_EXTERN_API_C ( TQ3Status ) 993 Q3SpotLight_SetHotAngle ( 994 TQ3LightObject light, 995 float hotAngle 996 ); 997 998 999 1000 /*! 1001 * @function 1002 * Q3SpotLight_SetOuterAngle 1003 * @discussion 1004 * Set the outer angle of a spot light. 1005 * 1006 * @param light The light to update. 1007 * @param outerAngle The new outer angle for the light. 1008 * @result Success or failure of the operation. 1009 */ 1010 Q3_EXTERN_API_C ( TQ3Status ) 1011 Q3SpotLight_SetOuterAngle ( 1012 TQ3LightObject light, 1013 float outerAngle 1014 ); 1015 1016 1017 1018 /*! 1019 * @function 1020 * Q3SpotLight_SetFallOff 1021 * @discussion 1022 * Set the fall off of a spot light. 1023 * 1024 * @param light The light to update. 1025 * @param fallOff The new fall off value for the light. 1026 * @result Success or failure of the operation. 1027 */ 1028 Q3_EXTERN_API_C ( TQ3Status ) 1029 Q3SpotLight_SetFallOff ( 1030 TQ3LightObject light, 1031 TQ3FallOffType fallOff 1032 ); 1033 1034 1035 1036 /*! 1037 * @function 1038 * Q3SpotLight_SetData 1039 * @discussion 1040 * Set the data for a spot light. 1041 * 1042 * @param light The light to update. 1043 * @param spotLightData The new data for the light. 1044 * @result Success or failure of the operation. 1045 */ 1046 Q3_EXTERN_API_C ( TQ3Status ) 1047 Q3SpotLight_SetData ( 1048 TQ3LightObject light, 1049 const TQ3SpotLightData *spotLightData 1050 ); 1051 1052 1053 1054 1055 1056 //============================================================================= 1057 // C++ postamble 1058 //----------------------------------------------------------------------------- 1059 #ifdef __cplusplus 1060 } 1061 #endif 1062 1063 #endif 1064 1065 1066