Epidemics, such as COVID-19, have caused significant harm to human society worldwide. A better understanding of epidemic transmission dynamics can contribute to more efficient prevention and control measures. Compartmental models, which assume homogeneous mixing of the population, have been widely used in the study of epidemic transmission dynamics, while agent-based models rely on a network definition for individuals. In this study, we developed a real-scale contact-dependent dynamic (CDD) model and combined it with the traditional susceptible-exposed-infectious-recovered (SEIR) compartment model. By considering individual random movement and disease spread, our simulations using the CDD-SEIR model reveal that the distribution of agent types in the community exhibits spatial heterogeneity. The estimated basic reproduction numberR0depends on group mobility, increasing logarithmically in strongly heterogeneous cases and saturating in weakly heterogeneous conditions. Notably,R0is approximately independent of virus virulence when group mobility is low. We also show that transmission through small amounts of long-term contact is possible due to short-term contact patterns. The dependence ofR0on environment and individual movement patterns implies that reduced contact time and vaccination policies can significantly reduce the virus transmission capacity in situations where the virus is highly transmissible (i.e.,R0is relatively large). This work provides new insights into how individual movement patterns affect virus spreading and how to protect people more efficiently.