/* $Id: instance.c,v 1.4 2002-07-17 21:55:19 bradleyb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* * * Instancing routines * * Old Log: * * Revision 1.2 1995/06/12 12:36:57 allender * fixed bug where g3_start_instance_angles recursively called itself * * Revision 1.1 1995/05/05 08:51:27 allender * Initial revision * * Revision 1.1 1995/04/17 06:43:29 matt * Initial revision * * */ #ifdef HAVE_CONFIG_H #include #endif #include #include "error.h" #include "3d.h" #include "globvars.h" #define MAX_INSTANCE_DEPTH 5 struct instance_context { vms_matrix m; vms_vector p; } instance_stack[MAX_INSTANCE_DEPTH]; int instance_depth = 0; //instance at specified point with specified orientation //if matrix==NULL, don't modify matrix. This will be like doing an offset void g3_start_instance_matrix(vms_vector *pos,vms_matrix *orient) { vms_vector tempv; vms_matrix tempm,tempm2; #ifdef D1XD3D Win32_start_instance_matrix (pos, orient); #endif Assert(instance_depth= 0); View_position = instance_stack[instance_depth].p; View_matrix = instance_stack[instance_depth].m; }