Added the Solid 3.5 sources to the blender source tree.
[blender.git] / extern / solid / src / broad / BP_C-api.cpp
1 /*
2  * SOLID - Software Library for Interference Detection
3  * 
4  * Copyright (C) 2001-2003  Dtecta.  All rights reserved.
5  *
6  * This library may be distributed under the terms of the Q Public License
7  * (QPL) as defined by Trolltech AS of Norway and appearing in the file
8  * LICENSE.QPL included in the packaging of this file.
9  *
10  * This library may be distributed and/or modified under the terms of the
11  * GNU General Public License (GPL) version 2 as published by the Free Software
12  * Foundation and appearing in the file LICENSE.GPL included in the
13  * packaging of this file.
14  *
15  * This library is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  *
18  * Commercial use or any other use of this library not covered by either 
19  * the QPL or the GPL requires an additional license from Dtecta. 
20  * Please contact info@dtecta.com for enquiries about the terms of commercial
21  * use of this library.
22  */
23
24 #include "SOLID_broad.h"
25
26 #include "BP_Scene.h"
27 #include "BP_Proxy.h"
28
29 BP_SceneHandle BP_CreateScene(void *client_data,
30                                                           BP_Callback beginOverlap,
31                                                           BP_Callback endOverlap)
32 {
33         return (BP_SceneHandle)new BP_Scene(client_data, 
34                                                                                 beginOverlap, 
35                                                                                 endOverlap);
36 }
37
38  
39 void BP_DestroyScene(BP_SceneHandle scene)
40 {
41         delete (BP_Scene *)scene;
42 }
43         
44
45 BP_ProxyHandle BP_CreateProxy(BP_SceneHandle scene, void *object,
46                                                           const DT_Vector3 min, const DT_Vector3 max)
47 {
48         return (BP_ProxyHandle)
49                 ((BP_Scene *)scene)->createProxy(object, min, max);
50 }
51
52
53 void BP_DestroyProxy(BP_SceneHandle scene, BP_ProxyHandle proxy) 
54 {
55         ((BP_Scene *)scene)->destroyProxy((BP_Proxy *)proxy);
56 }
57
58
59
60 void BP_SetBBox(BP_ProxyHandle proxy, const DT_Vector3 min, const DT_Vector3 max)       
61 {
62         ((BP_Proxy *)proxy)->setBBox(min, max);
63 }
64
65 void *BP_RayCast(BP_SceneHandle scene, 
66                                  BP_RayCastCallback objectRayCast,
67                                  void *client_data,
68                                  const DT_Vector3 source,
69                                  const DT_Vector3 target,
70                                  DT_Scalar *lambda) 
71 {
72         return ((BP_Scene *)scene)->rayCast(objectRayCast,
73                                                                                 client_data,
74                                                                                 source, target,
75                                                                                 *lambda);
76 }
77