Changeset 494 for GraphicTest/Packages/bgrabitmap/part3d.inc
- Timestamp:
- Dec 22, 2016, 8:49:19 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/Packages/bgrabitmap/part3d.inc
r472 r494 14 14 FCoordPool: TBGRACoordPool3D; 15 15 FNormalPool: TBGRANormalPool3D; 16 FObject3D: TBGRAObject3D; 16 17 public 17 constructor Create(A Container: IBGRAPart3D);18 constructor Create(AObject3D: TBGRAObject3D; AContainer: IBGRAPart3D); 18 19 destructor Destroy; override; 19 20 procedure Clear(ARecursive: boolean); … … 214 215 end; 215 216 216 constructor TBGRAPart3D.Create(AContainer: IBGRAPart3D); 217 begin 217 constructor TBGRAPart3D.Create(AObject3D: TBGRAObject3D; AContainer: IBGRAPart3D); 218 begin 219 FObject3D := AObject3D; 218 220 FContainer := AContainer; 219 221 FMatrix := MatrixIdentity3D; … … 229 231 FVertexCount := 0; 230 232 if FCoordPool.UsedCapacity > 0 then 231 raise Exception.Create('Coordinate pool still used ');233 raise Exception.Create('Coordinate pool still used. Please set vertex references to nil before destroying the scene.'); 232 234 FreeAndNil(FCoordPool); 233 235 if Assigned(FNormalPool) then … … 258 260 function TBGRAPart3D.Add(x, y, z: single): IBGRAVertex3D; 259 261 begin 260 result := TBGRAVertex3D.Create(F CoordPool,Point3D(x,y,z));262 result := TBGRAVertex3D.Create(FObject3D,FCoordPool,Point3D(x,y,z)); 261 263 Add(result); 262 264 end; … … 264 266 function TBGRAPart3D.Add(pt: TPoint3D): IBGRAVertex3D; 265 267 begin 266 result := TBGRAVertex3D.Create(F CoordPool,pt);268 result := TBGRAVertex3D.Create(FObject3D,FCoordPool,pt); 267 269 Add(result); 268 270 end; … … 270 272 function TBGRAPart3D.Add(pt: TPoint3D; normal: TPoint3D): IBGRAVertex3D; 271 273 begin 272 result := TBGRAVertex3D.Create(F CoordPool,pt);274 result := TBGRAVertex3D.Create(FObject3D,FCoordPool,pt); 273 275 result.CustomNormal := normal; 274 276 Add(result); … … 277 279 function TBGRAPart3D.Add(pt: TPoint3D_128): IBGRAVertex3D; 278 280 begin 279 result := TBGRAVertex3D.Create(F CoordPool,pt);281 result := TBGRAVertex3D.Create(FObject3D,FCoordPool,pt); 280 282 Add(result); 281 283 end; … … 283 285 function TBGRAPart3D.Add(pt: TPoint3D_128; normal: TPoint3D_128): IBGRAVertex3D; 284 286 begin 285 result := TBGRAVertex3D.Create(F CoordPool,pt);287 result := TBGRAVertex3D.Create(FObject3D,FCoordPool,pt); 286 288 result.CustomNormal := Point3D(normal); 287 289 Add(result); … … 312 314 setlength(result, length(pts)); 313 315 for i := 0 to high(pts) do 314 result[i] := TBGRAVertex3D.Create(F CoordPool,pts[i]);316 result[i] := TBGRAVertex3D.Create(FObject3D,FCoordPool,pts[i]); 315 317 Add(result); 316 318 end; … … 323 325 setlength(result, length(pts)); 324 326 for i := 0 to high(pts) do 325 result[i] := TBGRAVertex3D.Create(F CoordPool,pts[i]);327 result[i] := TBGRAVertex3D.Create(FObject3D,FCoordPool,pts[i]); 326 328 Add(result); 327 329 end; … … 490 492 end; 491 493 494 {$PUSH}{$OPTIMIZATION OFF} //avoids Internal error 2012090607 492 495 procedure TBGRAPart3D.ComputeWithMatrix(const AMatrix: TMatrix3D; const AProjection: TProjection3D); 493 496 var … … 501 504 FParts[i].ComputeWithMatrix(Composed,AProjection); 502 505 end; 506 {$POP} 503 507 504 508 function TBGRAPart3D.ComputeCoordinate(var ASceneCoord: TPoint3D_128; const AProjection: TProjection3D): TPointF; … … 550 554 if FPartCount = length(FParts) then 551 555 setlength(FParts, FPartCount*2+1); 552 result := TBGRAPart3D.Create( self);556 result := TBGRAPart3D.Create(FObject3D,self); 553 557 FParts[FPartCount] := result; 554 558 inc(FPartCount);
Note:
See TracChangeset
for help on using the changeset viewer.