Hilfe

ResetEntity

B3D

Aufruf

ResetEntity entity%

Parameter

entity% Identität eines 3D-Objekts (entity)


Rückgabewert

-


Beschreibung

Die Anweisung ResetEntity setzt den Kollisionsstatus eines bestimmten Objekts zurück. Dies könnte z.B. dann nützlich sein, wenn man ein Objekt mit PositionEntity verschieben möchte und dabei nicht mehr auf Kollision getestet werden soll.


Beispiel

Standardbeispiel:

Graphics3D 640, 480, 32, 2
SetBuffer BackBuffer()

Box = CreateCube()
Sphere = CreateSphere(16)

PositionEntity Box, 1, 0, 0
PositionEntity Sphere, - 1, 0, 0

EntityType Box, 1
EntityBox Box, - 0.5, - 0.5, - 0.5, 0.5, 0.5, 0.5
EntityType Sphere, 2
EntityRadius Sphere, 2

Camera = CreateCamera()
PositionEntity Camera, 0, 5, - 5
RotateEntity Camera, 45, 0, 0

Light = CreateLight(3, Camera)
LightRange Light, 5

While Not KeyDown(1)
   If KeyDown(203) Then MoveEntity Box, - 0.05, 0, 0
   If KeyDown(205) Then MoveEntity Box, 0.05, 0, 0
   If KeyDown(208) Then MoveEntity Box, 0, 0, - 0.05
   If KeyDown(200) Then MoveEntity Box, 0, 0, 0.05
   If KeyDown(28) Then
      Reset = 1
   Else
      Reset = 0
   EndIf
   Collisions 1, 2, 3, 3
   If Reset = 1 Then ResetEntity Box
   UpdateWorld : RenderWorld
   If Reset = 1 Then
      Text 0, 0, "Kollision von Box-Entity zurückgesetzt"
   EndIf
   Flip
Wend
End


Siehe auch

ClearCollisions, Collisions

Übersicht 3D Grafik Kollision