Beispiel #1
0
 private AABB GetAABB(NativeAttributeInfo attrInfo)
 {
     unsafe
     {
         NativeObjectAdapter nativeobj = this.As <NativeObjectAdapter>();
         ulong instanceId = nativeobj != null ? nativeobj.InstanceId : 0;
         if (instanceId != 0)
         {
             int    datasize = 0;
             IntPtr data;
             GameEngine.GetObjectProperty(attrInfo.TypeId, attrInfo.PropertyId, this.Cast <NativeObjectAdapter>().InstanceId
                                          , out data, out datasize);
             AABB bound = *(AABB *)data.ToPointer();
             return(bound);
         }
         return(new AABB());
     }
 }
Beispiel #2
0
 private AABB GetAABB(NativeAttributeInfo attrInfo)
 {
     unsafe
     {
         NativeObjectAdapter nativeobj = this.As <NativeObjectAdapter>();
         ulong instanceId = nativeobj != null ? nativeobj.InstanceId : 0;
         if (instanceId != 0)
         {
             int    datasize = 0;
             IntPtr data;
             var    nao = this.Cast <NativeObjectAdapter>();
             GameEngine.GetObjectProperty(attrInfo.TypeId, attrInfo.PropertyId,
                                          nao.DocumentId, nao.InstanceId,
                                          out data, out datasize);
             Vec3F *vecptr = (Vec3F *)data.ToPointer();
             AABB   bound  = new AABB(vecptr[0], vecptr[1]);
             return(bound);
         }
         return(new AABB());
     }
 }